2008/9/8 Donald Chai <[EMAIL PROTECTED]>: > On Sep 6, 2008, at 1:25 AM, Anselm R Garbe wrote: >> 2008/9/3 Donald Chai <[EMAIL PROTECTED]>: >>> 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.
I can't see why grabbing keys is an issue here. focus() only triggers a button grab on the old and new client which might causing this issue here. In Gnome WM you don't see this, because button grab's aren't necessary on a focus() basis, since it reparents the client windows and hence can keep the passive button grab for the whole lifetime of a client window on the frame window. So I fear, you/we have to live with this side effect. Kind regards, --Anselm
