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 734791 - Force showing the menu if ubuntu menuproxy is used
Force showing the menu if ubuntu menuproxy is used
Status: RESOLVED FIXED
Product: gnome-terminal
Classification: Core
Component: general
3.13.x
Other Linux
: Normal enhancement
: ---
Assigned To: GNOME Terminal Maintainers
GNOME Terminal Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-08-14 13:43 UTC by Egmont Koblinger
Modified: 2017-10-22 17:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Let GtkApplication load the app menu automatically (5.78 KB, patch)
2015-02-27 12:39 UTC, Lars Karlitski
committed Details | Review
Port menubar to GMenuModel (117.81 KB, patch)
2015-02-27 12:39 UTC, Lars Karlitski
none Details | Review
Port popup menus to GMenuModel (38.18 KB, patch)
2015-02-27 12:39 UTC, Lars Karlitski
none Details | Review
Don't unset ubuntu-specific env variables (816 bytes, patch)
2015-02-27 12:39 UTC, Lars Karlitski
none Details | Review

Description Egmont Koblinger 2014-08-14 13:43:48 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.
Comment 1 Christian Persch 2014-08-16 16:53:24 UTC
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.
Comment 2 Egmont Koblinger 2014-08-16 17:17:24 UTC
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...)-
Comment 3 Christian Persch 2014-08-16 17:48:55 UTC
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…
Comment 4 Egmont Koblinger 2014-08-16 18:25:12 UTC
Yup gtk-shell-shows-menubar is TRUE in Unity.
Comment 5 Egmont Koblinger 2014-08-27 22:52:54 UTC
The "Enable the menu accelerator key (F10 by default)" option is also useless with ubuntu menuproxy.
Comment 6 Christian Persch 2014-08-28 19:04:51 UTC
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... :-)
Comment 7 Lars Karlitski 2015-02-27 12:39:19 UTC
Created attachment 298079 [details] [review]
Let GtkApplication load the app menu automatically
Comment 8 Lars Karlitski 2015-02-27 12:39:28 UTC
Created attachment 298080 [details] [review]
Port menubar to GMenuModel
Comment 9 Lars Karlitski 2015-02-27 12:39:36 UTC
Created attachment 298081 [details] [review]
Port popup menus to GMenuModel
Comment 10 Lars Karlitski 2015-02-27 12:39:44 UTC
Created attachment 298082 [details] [review]
Don't unset ubuntu-specific env variables
Comment 11 Lars Karlitski 2015-02-27 12:42:10 UTC
(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.
Comment 12 Christian Persch 2015-02-27 17:50:14 UTC
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.)
Comment 13 Lars Karlitski 2015-02-28 12:49:07 UTC
(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 14 Debarshi Ray 2015-03-30 08:50:49 UTC
Comment on attachment 298079 [details] [review]
Let GtkApplication load the app menu automatically

chpe pushed this to master.
Comment 15 Christian Persch 2017-10-22 17:01:25 UTC
Fixed with the gmenu port.