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 571616 - Can not select item in menu.
Can not select item in menu.
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2009-02-13 12:19 UTC by Achim Frase
Modified: 2009-03-16 16:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
This shows the problem with mutter and gnome-display-properties (744.49 KB, video/ogg)
2009-02-13 12:23 UTC, Achim Frase
  Details
Ignore override-redirect windows when restacking based on window groups. (1.35 KB, patch)
2009-02-26 15:05 UTC, Dan Winship
none Details | Review

Description Achim Frase 2009-02-13 12:19:37 UTC
Please describe the problem:
If I try to select another resolution in gnome-display-properties it is not possible to select the upper entrys with the mouse.

Steps to reproduce:
1. run gnome-display-properties
2. try to select the uppermost entry (resolution)

Actual results:
I am not able to select the upper entrys

Expected results:
I should be able to select the entrys with my mouse.

Does this happen every time?
Yes this happens every time.

Other information:
With normal metacity without mutter everything is okay.

I will attach a little demo video.
Comment 1 Achim Frase 2009-02-13 12:23:04 UTC
Created attachment 128635 [details]
This shows the problem with mutter and gnome-display-properties
Comment 2 Dan Winship 2009-02-16 18:22:47 UTC
wacky. probably somehow related to the override-redirect window that gnome-display-properties creates?

Probably entirely a mutter bug, not gnome-shell, so you may want to file a bug at bugzilla.o-hand.com
Comment 3 Achim Frase 2009-02-19 18:34:17 UTC
Okay, I have created a bug-report at the o-hand Bugzilla.

http://bugzilla.openedhand.com/show_bug.cgi?id=1461
Comment 4 Tomas Frydrych 2009-02-20 09:43:23 UTC
I am not entirely convinced this is a mutter bug; I used to see this all time with regular metacity when I used to run Ubuntu, and it went away when I switched to debian about a year ago. The list looks like it is full of empty items on the top that were not taken into account when the list size was calculated, so it has to show the arrows; as soon as  you scroll the list, the empty items are gone and the arrows disappears. It is possible that metacity is moving the OR window to the wrong location when it maps, but I cannot reproduce this either with metacity or mutter.
Comment 5 Owen Taylor 2009-02-20 13:21:19 UTC
Tomas - actually this is something different - it's not the standard (as designed) behavior where GTK+ tries hard to put the current item under the mouse when you pop an option menu up.

This is a much weirder behavior where menu items that are over the parent window aren't selectable. It feels like there is an input only window that is getting misstaked or something. It may be specific to particular versions of gnome-display-properties - maybe omething to do with the little monitor labels it puts up.
Comment 6 Tomas Frydrych 2009-02-20 14:26:36 UTC
Right; Mutter doesn't handle any pointer events, the stage window input shape is set to 0x0, and we do not create any windows ourselves. So the three scenarios I can think of are (a) the Shell is blocking input (changing input shape of stage, for example), or (b) there is an input-only window created by the application itself that is incorrectly sized/placed, or (c) the Metacity stack is messed up, with the menu being stacked below the application. Looking at the video again, (c) seems a very distinct possibility -- should be easy to verify with xwininfo/xprop, but I can't reproduce it.
Comment 7 Dan Winship 2009-02-20 15:32:49 UTC
yes, the immediate problem seems to be the stacking order, but more generally, the problem seems to be that in gnome-shell the main gnome-display-properties window is always stacked above every other gtk window (including the bottom panel and gnome-display-properties's override-redirect monitor label) even though it doesn't have any of the properties that would cause it to be stacked specially.

i'll keep investigating
Comment 8 Tomas Frydrych 2009-02-20 15:49:44 UTC
Is it by any chance stacked above the stage window ?
Comment 9 Dan Winship 2009-02-20 16:21:35 UTC
There's only one window in the "xwininfo -tree -root" output that is full-screen-sized, so I'm assuming that the stage window you're talking about, but it's at the very very bottom of the window stack.

gnome-display-properties behaves normally if either (a) you tweak the glade file so that it has window hint "normal" instead of "dialog", or (b) you hack gnome-desktop so that GnomeRRLabeler creates a GTK_WINDOW_TOPLEVEL instead of a GTK_WINDOW_POPUP. Perhaps mutter is mistakenly treating the main window as being TRANSIENT_FOR the monitor label window?
Comment 10 Tomas Frydrych 2009-02-20 17:15:13 UTC
OK, I think I see what is going on here. The menu that gnome-display-properties shows is a pop-up menu, and looking at the gtk code this is made transient for the application top-level window. So, this gets stacked based on the transiency just above the app window.

I suspect that the override-redirect window that is created by the labeler is not marked as transient (or transient to root) and so ends up in the META_LAYER_OVERRIDE_REDIRECT layer that is above everything else. If I am correct, making this window also transient to the application should fix this problem (the reason this would not happen with regular metacity is because it does not track OR windows, so if the menu is created after the labeler, it will be stacked above).

Comment 11 Dan Winship 2009-02-26 15:03:44 UTC
OK, running with METACITY_VERBOSE:

    STACK: Adding window 0xc00003 (gnome-disp) to the stack

That's the override-redirect labeler window

    STACK: Recomputing layers
    STACK: Window 0xc00003 (gnome-disp) on layer 7 type = 15 has_focus = 0

layer 7 = META_LAYER_OVERRIDE_REDIRECT. Everything is good so far.

    STACK: Adding window 0xc00020 (Monitor Re) to the stack

That's the main window

    STACK: Recomputing layers
    STACK: Promoting window 0xc00020 (Monitor Re) from layer 2 to 7 due to group membership

And here's the bug. The main window gets promoted to META_LAYER_OVERRIDE_REDIRECT, but it shouldn't.

(In reply to comment #10)
> If I am
> correct, making this window also transient to the application should fix this
> problem

That might work around the problem, but it seems like the bug is in mutter, not gnome-display-properties; apps are generally allowed to assume that the wm will ignore override-redirect windows, and will not change the behavior of other windows in the application based on what the app does with the override-redirect ones.
Comment 12 Dan Winship 2009-02-26 15:05:11 UTC
Created attachment 129571 [details] [review]
Ignore override-redirect windows when restacking based on window groups.

This fixes gnome-display-properties. There may be other patches needed
here or elsewhere for similar problems?
Comment 13 Tomas Frydrych 2009-02-26 16:37:54 UTC
Many thanks for tracking this down; the patch looks sound, I put it on my TODO list to test that nothing unexpected breaks.

As a side note, this merely confirms my conviction that override-redirect windows are truly evil (and often abused; lot of stuff that ORs are used for can be accomplished using EWMHs); the assumption that the WM will (can) ignore ORs only really holds when no compositing is involved, once you start compositing the entire concept of an OR window becomes somewhat meaningless. But that's me just ranting ...
Comment 14 Tomas Frydrych 2009-03-12 15:00:21 UTC
Patch applied in commit e0915f4daa7feea10de42b18108139661f346dff.
Comment 15 Owen Taylor 2009-03-16 16:01:49 UTC
Merged into gnome-shell branch.