GNOME Bugzilla – Bug 735487
Duplicate menu items when running in environments that don't show the app menu
Last modified: 2016-09-11 03:47:41 UTC
Created attachment 284554 [details] screenshot 1 When the GtkSetting shell-shows-app-menu is FALSE, we show the app menu in the start of the header bar, but we also duplicate all the app menu items in the gear menu. It looks like we use gtk_application_window_set_show_menubar() in an attempt to prevent it from showing a menubar with the fallback app menu, but now that the fallback app menu has moved to the header bar, this doesn't work. I'm not really sure how we can trick GTK+ into not showing the fallback app menu in the header bar, except by not setting the app menu in the first place. I see two options: * Stop duplicating app menu items in the gear menu and accept that we show a fallback app menu in the headerbar. * Test with gtk_application_prefers_app_menu() before calling gtk_application_set_app_menu() so that we don't set an app menu at all. The disadvantage of the second option is that we won't be able to respond immediately to changes in the shell-shows-app-menu setting, like we currently do.
Created attachment 284555 [details] screenshot 1 for real
No screenshot two; it seems to be not possible to take a screenshot of the hamburger menu.
(In reply to comment #0) > * Stop duplicating app menu items in the gear menu and accept that we show a > fallback app menu in the headerbar. This is what we're doing for nautilus.
Created attachment 284630 [details] [review] Stop duplicating items between menus Nowadays the app menu is shown in the header bar, so we don't want to put these items in the window menu anymore. Reducing the size of this menu also prepares us for using a popover menu. This patch should be applied after the patch in bug #735540.
Note: The above patch removes the short cut handling for incognito mode (ctrl+shift+n) due to removal of incognito menu item in pagepopup.
Review of attachment 284630 [details] [review]: Needs to not remove the shortcut
TBH, I have no clue why it broke exactly one shortcut. Seems like either the shortcuts should all still work, or all be broken. Anyway, GtkAction and GtkUIManager are both deprecated; I've only seen them used in Epiphany and Nautilus (which no longer uses them) and I clearly don't understand how to use them properly. I will try to switch us to use GAction instead, which has a dramatically easier API. The minor problem is we need new API in WebKitGTK+ for this, to handle context menus. I don't plan to work on this in the near future, so for the time being I'll drop the patch from the Fedora build, since it only matters for people using Epiphany outside of GNOME, which should be a small minority of users.