Re: Broken enter-exit focus behavior in 1.5.3

On Friday 04 December 2009 05:08:06 sand blarg net wrote:
>   4. With my current focus-mode function, when cancelling from the
>   dialog box, I should expect focus to go to whatever window is
>   underneath the pointer when cancelling, possibly the root window.
> Correct?

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 

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.

	Timo Korvola		<URL:>

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