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 792312 - [gnome-terminal] GtkApplication accels set from API not reported on DBus
[gnome-terminal] GtkApplication accels set from API not reported on DBus
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Class: GtkApplication
3.22.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2018-01-07 22:59 UTC by Egmont Koblinger
Modified: 2018-05-02 19:41 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Egmont Koblinger 2018-01-07 22:59:04 UTC
With the GMenu port, shortcuts are no longer shown in the menu.

It's especially bad for discoverability since the terminal emulator often uses nonstandard shortcuts (requiring Shift+Ctrl) and users shouldn't need to open Preferences -> Shortcuts to figure them out.

I hope this is not "by design" or is a limitation of GMenu. Christian, could you please look at it? Thanks!
Comment 1 Christian Persch 2018-01-07 23:39:44 UTC
Works here; those shortcuts that are set to non-Disabled in the shortcuts editor are displayed in the menus.

Is this about the in-window menubar, or the shell-top-panel out-of-window menubar on unity?
Comment 2 Christian Persch 2018-01-07 23:40:47 UTC
(And if you've disabled all shortcuts from the checkbox in the Shortcuts tab of the prefs, then of course no shortcuts are displayed at all.)
Comment 3 Egmont Koblinger 2018-01-08 08:43:14 UTC
It's indeed Unity7 only, works as expected in gnome-shell (X11 and Wayland).

Missing for either setting of System Settings -> Appearance -> Behavior ->
  Show the menus for a window
   o In the menu bar
   o In the window's title bar
Comment 4 Christian Persch 2018-01-08 10:47:27 UTC
I'd say to test with another GMenu-based app to see if it's something we do incorrectly or something in unity, but I think there aren't any other apps that use a menubar and have ported to GMenu…
Comment 5 Christian Persch 2018-01-08 16:57:27 UTC
Actually there is one, and even one of *mine*: gucharmap ! So can you please try to see if the same happens there?
Comment 6 Egmont Koblinger 2018-01-08 19:14:06 UTC
In gucharmap the shortcuts do show up for me (both the distro package and git master).
Comment 7 Christian Persch 2018-01-08 20:00:30 UTC
The difference here is that in gucharmap the accels are defined .ui file, while in gnome-terminal, they are only defined via API (gtk_application_add/remove_accelerator()). The in-app menubar uses both the .UI provided accels and the API accels (and if the UI file provides accels, they are displayed all the time in precedence to the API accels, which is why g-t doesn't do that).

I don't know if the API accels aren't exported by GtkApplication, or if unity just doesn't use them.
Comment 8 Egmont Koblinger 2018-01-08 20:53:53 UTC
Indeed, if I add an "accel" to terminal-menubar.ui, it does show up.

API ones don't. Removing the shadow_action stuff doesn't help, nor does switching to the non-deprecated gtk_application_set_accels_for_action().

Given that only Unity is affected which is no longer Ubuntu's default, and the fix doesn't seem to be easy (and probably it's not even gnome-terminal's fault), I don't mind if we focus on other bugs instead :)
Comment 9 Christian Persch 2018-01-08 22:24:05 UTC
I've looked at the dbus traffic when changing an accel, and there's nothing. So unity couldn't react even if it wanted to.

Re-assigning to gtk+.
Comment 10 Matthias Clasen 2018-01-08 22:39:30 UTC
I'm not fully convinced that application shortcuts belong into global menus
Comment 11 Egmont Koblinger 2018-01-29 20:51:50 UTC
Probably closely related, not sure if I should open a new bug for this:

Disabling the menu's mnemonics (e.g. Alt+F for File, Alt+E for Edit...) doesn't work either in Unity 7 as of the GMenu port. They always open the menu, no matter what's in gnome-terminal's configs.
Comment 12 Christian Persch 2018-01-29 21:26:13 UTC
(In reply to Matthias Clasen from comment #10)
> I'm not fully convinced that application shortcuts belong into global menus

I don't have an opinion on that, I'm just pointing out the inconsistency of accels defined in the .ui file being exported, while dynamically set accels not being exported.

(In reply to Egmont Koblinger from comment #11)
> Probably closely related, not sure if I should open a new bug for this:
> 
> Disabling the menu's mnemonics (e.g. Alt+F for File, Alt+E for Edit...)
> doesn't work either in Unity 7 as of the GMenu port. They always open the
> menu, no matter what's in gnome-terminal's configs.

That would be a unity bug, wouldn't it? Their menubar probably grabs keys globally before the application even sees them, and since the menubar isn't in the g-t-s process, there's no way the GtkSetting would affect it.
Comment 13 Egmont Koblinger 2018-01-29 21:30:18 UTC
(In reply to Christian Persch from comment #12)

> That would be a unity bug, wouldn't it?

I don't think so, as this one also worked correctly before the GMenu port. Although I have to admit I don't understand a single bit of what's happening here behind the scenes :-)
Comment 14 Daniel Boles 2018-03-12 23:40:01 UTC
I think this may be a dupe of Bug 787342
Comment 15 Christian Persch 2018-03-13 00:35:04 UTC
Note sure about that...

(From bug 787342 comment 0):
> Add an accelerator key to a menu entry using a .ui file,
> Gtk.Application.add_accelerator or Gtk.Application.set_accels_for_action.

Accels are shown in the app menu / global menu bar if they are defined in the .ui file; it's only the dynamically added items that aren't exported. If in bug 787342 the .ui ones are also affected, then it's a different issue.
Comment 16 GNOME Infrastructure Team 2018-05-02 19:41:13 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/1009.