GNOME Bugzilla – Bug 764975
GTKShortcutWindow runtime changes to accelerator not reflected in Search
Last modified: 2016-04-17 20:21:01 UTC
I've added a GTKShortcutWindow to my application (https://github.com/gnunn1/terminix) which allows users to customize the shortcuts in a fashion similar to gnome-terminal. I'm having an issue with the search facility in that while it shows the matching actions the associated accelerator isn't displayed. After playing around a bit, it looks like the search capability is driven off of the initial load of the widgets and any changes at runtime to accelerators in GTKShortcutShortcut are ignored. In my application the ui file doesn't specify any accelerators, after I use GTKBuilder to load the ui file I iterate over all my shortcuts and assign the accelerator at that time. If I modify the ui file to assign a temporary accelerator, the search feature shows the temporary accelerator instead of the one assigned at runtime.
Sounds like a bug. Patch more than welcome, otherwise I will get around to looking at this eventually.
Pushed a change that lets you fix tihs for 3.22. Instead of setting GtkShortcutsShortcut::accelerator, set GtkShortcutsShortcut::action-name.