GNOME Bugzilla – Bug 792312
[gnome-terminal] GtkApplication accels set from API not reported on DBus
Last modified: 2018-05-02 19:41:13 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!
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?
(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.)
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
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…
Actually there is one, and even one of *mine*: gucharmap ! So can you please try to see if the same happens there?
In gucharmap the shortcuts do show up for me (both the distro package and git master).
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.
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 :)
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+.
I'm not fully convinced that application shortcuts belong into global menus
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.
(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.
(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 :-)
I think this may be a dupe of Bug 787342
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.
-- 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.