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 662691 - menuitem: Always treat submenus as popup
menuitem: Always treat submenus as popup
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkMenu
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2011-10-25 16:48 UTC by Florian Müllner
Modified: 2011-11-05 05:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
menuitem: Always treat submenus as popup (1.38 KB, patch)
2011-10-25 16:48 UTC, Florian Müllner
accepted-commit_now Details | Review
menuitem: Always treat submenus as popup (1.38 KB, patch)
2011-11-05 05:50 UTC, Matthias Clasen
committed Details | Review

Description Florian Müllner 2011-10-25 16:48:49 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)
Comment 1 Florian Müllner 2011-10-25 16:48:52 UTC
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.
Comment 2 Matthias Clasen 2011-10-26 17:02:33 UTC
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 ?
Comment 3 Florian Müllner 2011-10-26 18:36:59 UTC
(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).
Comment 4 Matthias Clasen 2011-10-27 00:24:28 UTC
Review of attachment 199950 [details] [review]:

Ok, looking at the emwh, I think this is a fine change to make.
Comment 5 Matthias Clasen 2011-11-05 05:50:31 UTC
The following fix has been pushed:
79803d0 menuitem: Always treat submenus as popup
Comment 6 Matthias Clasen 2011-11-05 05:50:34 UTC
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.