codehenry / xmonad

Automatically exported from code.google.com/p/xmonad
0 stars 0 forks source link

Actions.UpdateFocus only works on terminals, not qt/gtk/etc #324

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. XMonad 0.9 and use XMonad.Actions.UpdateFocus as in the documentation
2. Open windows on two different WorkSpaces and tab
3. Switch between WorkSpaces

What is the expected output? What do you see instead?

If the mouse lands on a gtk/qt/etc window, wiggling it will not update the
focus.

I tested with firefox,gedit,agave,lyx

Original issue reported on code.google.com by OrbisVi...@gmail.com on 3 Nov 2009 at 12:20

GoogleCodeExporter commented 8 years ago
I can reproduce this, looks like a bug in UpdateFocus.  Unfortunately I don't
understand how UpdateFocus works well enough to have an idea of what is wrong.

Original comment by byor...@gmail.com on 26 Nov 2009 at 5:51

GoogleCodeExporter commented 8 years ago
The problem here is that if a window is interested in its MotionEvents, or 
prohibits
propagation of these events, xmonad does not see them. Citing from
http://tronche.com/gui/x/xlib/events/keyboard-pointer/keyboard-pointer.html:

The source of the event is the viewable window that the pointer is in. The 
window
used by the X server to report these events depends on the window's position in 
the
window hierarchy and whether any intervening window prohibits the generation of 
these
events. Starting with the source window, the X server searches up the window
hierarchy until it locates the first window specified by a client as having an
interest in these events. If one of the intervening windows has its
do-not-propagate-mask set to prohibit generation of the event type, the events 
of
those types will be suppressed. Clients can modify the actual window used for
reporting by performing active grabs and, in the case of keyboard events, by 
using
the focus window.

I have no idea how to solve this properly, as listening for motion events on the
focused window itself will fix it only if the application listens on its main 
window
as well. If the application listens for motion events on a child window, we'd 
have to
listen on it as well. It is beyond my Xlib knowledge whether this can be done
differently.

Original comment by liskni...@gmail.com on 26 Nov 2009 at 2:31