GNOME Bugzilla – Bug 734791
Force showing the menu if ubuntu menuproxy is used
Last modified: 2017-10-22 17:01:25 UTC
Is there a way gnome-terminal could detect at runtime if Ubuntu's menuproxy is being used? If so, the "rightclick -> Show Menubar" and the "Preferences -> Show menubar by default" options could be hidden and the menu forced to be shown. Toggling "Show Menubar" doesn't have immediate effect, this could be a bug in menuproxy or whatever. If turned off by default and g-t is restarted, its menu is reduced to the "Terminal" (-> New, Prefs, Help, About, Quit) column, the other columns (Edit, View, Search, Terminal, Help) are missing, but still the same amount of screen real estate (the whole top bar of Unity) is taken up. So it makes no sense whatsoever to disable the menu, it's just confusing.
There is a GtkSetting for this, gtk-shell-shows-menubar. However, since this is not a gnome-shell feature, IMHO ubuntu should patch their g-t instead of this being done upstream.
Well... gnome-terminal has recently removed a couple of features where it differs from other apps (e.g. transparency, word-chars), to be more similar to other Gnome apps and less "special". Other Gnome apps don't have the possibility to hide the menubar. The only reason I can think of for this feature is to save UI real estate, which can be done because in terminals usually the real work happens solely inside the terminal area, and only very rarely in g-t's menus. With that in mind, it's not Ubuntu's Unity and menuproxy that's special. It's gnome-terminal combined with the more traditional WMs (like gnome-shell) that is a special case and a reason for having this extra feature. Think of it like: toggling the menubar wouldn't be disabled for Unity, instead, it would be disabled by default and enabled especially for gnome-shell and alike WMs. It's technically the same, just a different philosophy behind :-) Just my 2 cents, not a firm opinion. > IMHO ubuntu should patch their g-t (They f*ing don't care about g-t, 14.10 is still about to ship g-t 3.6 because they can't figure out how to source vte.sh to keep the cwd. That's a different pathetic story...)-
Hmm. Does ubuntu/unity set that gtk setting to TRUE? If so, should be only a couple of LOC to hide the UI in menus and prefs dialogue, that would be ok-ish for me then. OTOH if they *don't* set it…
Yup gtk-shell-shows-menubar is TRUE in Unity.
The "Enable the menu accelerator key (F10 by default)" option is also useless with ubuntu menuproxy.
Not sure it's worth coding this since ubuntu seems unlikely to ever upgrade its g-t version, but if you want to, and it's not too much code... :-)
Created attachment 298079 [details] [review] Let GtkApplication load the app menu automatically
Created attachment 298080 [details] [review] Port menubar to GMenuModel
Created attachment 298081 [details] [review] Port popup menus to GMenuModel
Created attachment 298082 [details] [review] Don't unset ubuntu-specific env variables
(In reply to Christian Persch from comment #6) > Not sure it's worth coding this since ubuntu seems unlikely to ever upgrade > its g-t version, but if you want to, and it's not too much code... :-) Now that we did, let's fix this. The attached patches port the menubar and popup menus to GMenuModel and use gtk_application_set_menubar(), which decides whether to show the menubar in the window or the shell based on the xsetting mentioned above. They also hide the "Show menubar" menu items when the shell shows the menu.
Hmm, I had expected something rather like g_object_get(gtk_settings_get_default(), "....", &shell_shows_menubar, NULL); gtk_action_set_visible(action, !shell_shows_menubar); here rather than a complete port to gmenu... (Can you please file a separate bug for the gmenu stuff and push a wip branch; this certainly is not 3-16 material.)
(In reply to Christian Persch from comment #12) > Hmm, I had expected something rather like > > g_object_get(gtk_settings_get_default(), "....", &shell_shows_menubar, NULL); > gtk_action_set_visible(action, !shell_shows_menubar); > > here rather than a complete port to gmenu... This will not work in the general case, because you need to export the menu so that the shell can see it. (It works on Ubuntu because of a gtk module that parses the menu hierarchy and exports that. That's pretty inefficient and I'd like to move away from that.) > (Can you please file a separate bug for the gmenu stuff and push a wip > branch; this certainly is not 3-16 material.) Pushed to wip/larsu/gmenumodel and filed bug #745329. I didn't expect this to go in this cycle, as the modifications are quite large. I hope to get it in at the start of next so that it gets some testing before release.
Comment on attachment 298079 [details] [review] Let GtkApplication load the app menu automatically chpe pushed this to master.
Fixed with the gmenu port.