Re: Broken enter-exit focus behavior in 1.5.3



Timo Korvola writes:
> No.  It is more complicated than that.  When a transient window closes, 
> focus is directed to the transient parent by transient-unmap-window 
> (well, not exactly, check the code).  This happens regardless of focus 
> mode.  The focus mode gets called with focus-revert only if the closing 
> window is not transient or if it does not make sense to focus its 
> parent.
> 
> However, if the closing window happened to be grabbing the pointer, 
> release of the grab generates an EnterNotify event that, with your 
> changes, sends focus to the pointer window.  This happens after 
> transient-unmap-window, so whatever is done there gets overridden.  Most 
> windows do not grab the pointer but Qt and GTK menus do and combo boxes 
> did in Qt 3.  So when a menu is closed, with your changes focus goes to 
> the window under the pointer instead of the window that the menu belongs 
> to.  This is particularly annoying with the KDE 3 Run Command dialog, 
> which is usually popped up with Alt-F2 and configured to get focus when 
> mapped.  Its completion list causes a similar effect.

So...

1. Bring up GNU Emacs23 with GTK menus.

2. Shrink the Emacs window so that the menus will extend below the
window.

3. Press Button1 to pop open a menu, and drag the mouse so that the
pointer is off the menu, and over a different window.  Release the
mouse button.

With stock version 1.5.3, the Emacs window will keep the focus, even
if the pointer is over the root window, or over an application window.
With my custom function, focus will go to whatever window the pointer
happens to be over.

That's precisely the behavior I would expect for a focus-follows-mouse
policy.  Moving the pointer back to the Emacs window is trivial since
I already have my hand on the mouse.


I did notice while verifying the 1.5.3 behavior that focus doesn't
always go back to Emacs when you release the mouse button over the
root window.  Sometimes the Emacs window loses focus.  I didn't notice
this when releasing over an app window, however.


Derek

-- 
Derek Upham
sand blarg net


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]