GNOME Bugzilla – Bug 662691
menuitem: Always treat submenus as popup
Last modified: 2011-11-05 05:50:34 UTC
Requested by Lapo, see attached patch. (menuitem:from_menubar is only used for the window type hint, so the patch should be fairly safe)
Created attachment 199950 [details] [review] menuitem: Always treat submenus as popup Submenus are not actually attached to a menubar, but styling them as if they were imposes some problems (at least with Adwaita). Just using GDK_WINDOW_TYPE_HINT_POPUP_MENU for submenus instead fixes the issue.
Might happen to work with adwaita and mutter currently, but doesn't really strike me as the right fix. It seems to me that we want to clarify what the various bits here actually mean. from_menubar seems to be used to indicate that a menuitem lives inside a hierarchy that is rooted in a menubar. In what cases is it actually going to be FALSE ? context menus ? combo box ? On the other hand, from_menubar seems to _only_ be used when popping up submenus. So maybe, we can just never set it ? What difference does the window type hint make ? Is mutter using it to determine shadows ?
(In reply to comment #2) > Might happen to work with adwaita and mutter currently, but doesn't really > strike me as the right fix. It seems to me that we want to clarify what the > various bits here actually mean. Right, changing the type hint of submenus means changing GTK+'s interpretation of the EWMH spec, so "clarify first" looks like a good idea. For what it's worth, I did not find explicit mention of submenus in either EWMH or GTK+'s documentation, and both have definitions of DROPDOWN_MENU vs. POPUP_MENU which are (in my opinion) sufficiently vague to allow for such a change. > from_menubar seems to be used to indicate that a menuitem lives inside a > hierarchy that is rooted in a menubar. In what cases is it actually going to be > FALSE ? context menus ? combo box ? On the other hand, from_menubar seems to > _only_ be used when popping up submenus. So maybe, we can just never set it ? Yeah, from_menubar is TRUE if a menu or any of its parents is attached to a menubar (so not combo boxes or context menus). I certainly wouldn't mind removing it altogether, but that pretty much implies changing the type hint of submenus (the only use I see for from_menubar is to avoid iterating over the menu hierarchy when determining the type hint of submenus) > What difference does the window type hint make ? Is mutter using it to > determine shadows ? Exactly. The issue at hand is that the current theme relies on wm shadows to add a "border" to the popup leaving out the top so the menu appears attached to the menubar. For submenus, this means that they menu "bleeds" into light window content (to be honest, it's so subtle that I did not notice it myself until pointed out by Lapo).
Review of attachment 199950 [details] [review]: Ok, looking at the emwh, I think this is a fine change to make.
The following fix has been pushed: 79803d0 menuitem: Always treat submenus as popup
Created attachment 200741 [details] [review] menuitem: Always treat submenus as popup Submenus are not actually attached to a menubar, but styling them as if they were imposes some problems (at least with Adwaita). Just using GDK_WINDOW_TYPE_HINT_POPUP_MENU for submenus instead fixes the issue.