After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 519188 - window won't get focused when using gtk_window_set_keep_above()
window won't get focused when using gtk_window_set_keep_above()
Status: RESOLVED FIXED
Product: metacity
Classification: Other
Component: general
2.21.x
Other Linux
: High normal
: ---
Assigned To: Metacity maintainers list
Metacity maintainers list
Depends on:
Blocks:
 
 
Reported: 2008-02-28 03:28 UTC by David Zeuthen (not reading bugmail)
Modified: 2008-06-19 14:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test case (903 bytes, text/plain)
2008-02-28 03:29 UTC, David Zeuthen (not reading bugmail)
  Details
Don't check overlap of a window with itself (415 bytes, patch)
2008-03-12 15:33 UTC, Marco Pesenti Gritti
none Details | Review
Updated to apply to svn trunk (442 bytes, patch)
2008-03-12 18:22 UTC, Marco Pesenti Gritti
committed Details | Review

Description David Zeuthen (not reading bugmail) 2008-02-28 03:28:50 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.
Comment 1 David Zeuthen (not reading bugmail) 2008-02-28 03:29:17 UTC
Created attachment 106129 [details]
test case
Comment 2 David Zeuthen (not reading bugmail) 2008-02-28 03:30:40 UTC
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.
Comment 3 David Zeuthen (not reading bugmail) 2008-02-28 03:31:50 UTC
To clarify.. the problem is that window created by the program in comment 1 won't get focused.
Comment 4 David Zeuthen (not reading bugmail) 2008-02-28 03:43:44 UTC
(fix typo in summary)
Comment 5 David Zeuthen (not reading bugmail) 2008-02-28 17:49:42 UTC
Also.. to further clarify.. when removing the gtk_window_set_keep_above() call my window gets focused properly.
Comment 6 David Zeuthen (not reading bugmail) 2008-02-28 17:59:49 UTC
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
Comment 7 Soren Sandmann Pedersen 2008-02-28 18:07:44 UTC
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.
Comment 8 David Zeuthen (not reading bugmail) 2008-03-03 18:05:59 UTC
this also affects gnome-keyring and it's "unlock keyring" dialog
Comment 9 David Zeuthen (not reading bugmail) 2008-03-03 18:08:00 UTC
Shouldn't this be a 2.22 blocker? It's pretty bad....
Comment 10 Thomas Thurman 2008-03-03 18:23:20 UTC
Is this perhaps related to bug 487356? They seem similar.
Comment 11 Baptiste Mille-Mathias 2008-03-06 07:42:04 UTC
affected and confirming
Comment 12 Marco Pesenti Gritti 2008-03-12 14:43:55 UTC
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.
Comment 13 Thomas Thurman 2008-03-12 14:49:41 UTC
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 :(
Comment 14 Marco Pesenti Gritti 2008-03-12 15:33:35 UTC
Created attachment 107152 [details] [review]
Don't check overlap of a window with itself
Comment 15 Marco Pesenti Gritti 2008-03-12 18:22:59 UTC
Created attachment 107165 [details] [review]
Updated to apply to svn trunk
Comment 16 David Zeuthen (not reading bugmail) 2008-03-18 07:57:58 UTC
The patch in comment 15 fixes the problem. Thanks Marco!
Comment 17 Thomas Thurman 2008-03-18 12:26:59 UTC
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
Comment 18 Federico Mena Quintero 2008-05-06 18:33:19 UTC
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?]
Comment 19 Thomas Thurman 2008-05-06 18:38:29 UTC
It could do.  I will if you think I should.
Comment 20 Federico Mena Quintero 2008-05-06 21:16:00 UTC
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) ;)