Re: Spontaneous Loss of Focus
Re: Spontaneous Loss of Focus
- Subject: Re: Spontaneous Loss of Focus
- From: Eeri Kask <email@hidden>
- Date: Wed, 20 Jul 2011 12:34:45 +0200
On 07/19/2011 1:40 AM, Andre Skarzynski <email@hidden> wrote:
>> Then when you start X11, you'll get an xterm with no window manager. If you quit the xterm, X11 exits. Start quartz-wm from that xterm, and when you experience the problem, kill quartz-wm and restart it. Let me know if the problem goes away.
>
> So I tried this, and yes, I get the problem, but when I kill "quartz-wm" and start it again the problem is gone. So I see the issue is with "quartz-wm", I think. I noticed that /usr/bin/quartz-wm is run if I don't give a full pathname. I did try /opt/X11/bin/quartz-wm, but the focus loss problem still comes back.
>
> The good thing is I can now regain control of my X11 apps with out killing them, but I need to keep killing and re-starting quartz-wm.
>
> So, has this problem been solved yet? Or can anyone suggest what I should do next. Apologies if it has already been covered, but I have never found a solution yet.
Instead of killing WM, would this small program
#include <X11/Xlib.h>
main ()
{
Display * dsp = XOpenDisplay (0);
if (dsp) {
XSetInputFocus (dsp, PointerRoot, RevertToPointerRoot,
CurrentTime);
XCloseDisplay (dsp);
}
}
kind of recover focus in your case?
A decent WM would (1) discover this enforced focus state change, and
(2) honour this focus change; so there is hope at least one can
travel the mouse into the "nearest" window which then gets keyboard
input delivered there by the X11-server. (A decent WM would then
discover you moving mouse into that window and recover/reset its
internal focus management.) :-)
It is not quite clear if quartz-wm in itself is the source of the
problem above. It is known that the Xorg server in some rare
circumstances doesn't deliver 'EnterNotify' events if the mouse
enters some toplevel window which can be accomplished by moving the
mouse ... or if some window pops up on the screen exactly under the
mouse. In the latter case in rare occasions X11-server doesn't
deliver EnterNotify events to the affected, newly mapped toplevel
window. (This happens even without any WM running, so this is
provably not a WM-related issue.)
As under MacOS the XQuartz is probably architectured ontop of Quartz
(or whatever) input-output architecture this missing events
phenomenon may be further escalated as here these missing
EnterNotify events are pretty frequent which confuse the WM focus
management if it relies on EnterNotify events (which many do, e.g.
by supporting sloppy-focus or focus-follows-mouse policy). Trying
some other WM and observing the same focus problems would confirm
this missing-events hypothesis (or by something like 'xev' try
discover missing events).
Eeri Kask
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden