On Sep 6, 2008, at 1:25 AM, Anselm R Garbe wrote:

2008/9/3 Donald Chai <[EMAIL PROTECTED]>:
I'm sure there might be other problems I created...I don't understand the
X11 event model at all.

Yes you did. It is important to showhide() before focus and restack
handling. I also slightly changed your initial showhide() version. See
hg tip for reference.

You're right.

For example, if my pointer is located over window A, and I use the keyboard
to switch between windows B and C, window A briefly gets focus.

Yes, this was because you performed showhide() after restack(). At the
end of restack all enternotify's are flushed.

Actually, this is a totally unrelated problem. The problem is that XGrabKeyboard generates focus events (XGrabKeyboard is called by the X server after establishing the passive grab with XGrabKey).

So, all keyboard shortcuts cause the window under the mouse to briefly get focus. I've used Metacity (the GNOME WM) with focus- follows-mouse, and it doesn't have this behavior when I Alt-Tab.


Reply via email to