GNOME Bugzilla – Bug 519188
window won't get focused when using gtk_window_set_keep_above()
Last modified: 2008-06-19 14:04:33 UTC
This is with metacity-2.21.13-1.fc9.i386 gtk2-2.12.8-1.fc9.i386 on Fedora Rawhide. Will attach a small test case.
Created attachment 106129 [details] test case
This affects - the PolicyKit-gnome authentication dialog - the Unlock Encrypted media authentication dialog in gnome-mount The problem started to appear early in the Fedora Rawhide cycle. It seems if the window is transient for another window this doesn't occur. But I didn't check very closely.
To clarify.. the problem is that window created by the program in comment 1 won't get focused.
(fix typo in summary)
Also.. to further clarify.. when removing the gtk_window_set_keep_above() call my window gets focused properly.
So ssp asked me on IRC when this happens. It happens when launching - from a terminal - via the alt+f2 run dialog - from a launcher (e.g. desktop file) created in Nautilus
It also happens when the desktop file contains StartupNotify=true Also, it looks like metacity goes completely into 'never focus any new windows' mode when there is a keep above window.
this also affects gnome-keyring and it's "unlock keyring" dialog
Shouldn't this be a 2.22 blocker? It's pretty bad....
Is this perhaps related to bug 487356? They seem similar.
affected and confirming
This has been introduced by 3358: 2007-10-16 Thomas Thurman <thomas@thurman.org.uk> * src/window.c (window_would_be_covered): new function. * src/window.c (meta_window_show): rewrite assertion not to put window on top in terms of window_would_be_covered(); remove assertion because it's no longer valid; explicitly don't focus windows that shouldn't be focussed; closes #486445.
a) Oh, awesome, thanks for tracking that down. I'll test that and see if I can work out a solution (unless someone else gets there first). b) Sorry :(
Created attachment 107152 [details] [review] Don't check overlap of a window with itself
Created attachment 107165 [details] [review] Updated to apply to svn trunk
The patch in comment 15 fixes the problem. Thanks Marco!
Excellent work, Marco and the rest of you-- thank you so much. Verified, checked in and closing. http://svn.gnome.org/viewvc/metacity?rev=3650&view=rev
Should this patch should also go into the gnome-2-22 branch? [Is there going to be another Metacity release in the 2.22.x series?]
It could do. I will if you think I should.
It would be nice to have the fix in the stable series --- is the wrong behavior without it very visible? (Now that bug #531609 seems to indicate that Metacity is not completely at fault with respect to PolicyKit's auth dialog, I'm not 100% sure that this is a critical fix, anyway.) Maybe just wait to see if any critical fixes appear, and only then do a backport/release (says me, from the viewpoint of a distro who would like to avoid cherry-picking patches from trunk and just pull a new tarball instead) ;)