GNOME Bugzilla – Bug 469374
menu accelerators don't work
Last modified: 2007-08-27 17:53:55 UTC
Please look at this thread http://mail.gnome.org/archives/gtk-app-devel-list/2007-August/msg00117.html Basically gtk_window_add_accel_group() must be called before adding any accelerators right now. Otherwise they don't work.
Created attachment 94144 [details] [review] notify key changes
please make diffs with -up to spare everyone from re-diffing against SVN just to read your patch.
Created attachment 94181 [details] [review] notify key changes well svn does not make that easy :/ svn diff --diff-cmd=diff -x -up gtkwindow.c >gtkwindow-accel.patch
(In reply to comment #0) > Please look at this thread > http://mail.gnome.org/archives/gtk-app-devel-list/2007-August/msg00117.html > > Basically gtk_window_add_accel_group() must be called before adding any > accelerators right now. Otherwise they don't work. thanks for catching, however the notification also needs to be added at the end of gtk_window_remove_accel_group(). can you take care of comitting and testing please?
Why do you think so. Could you try the standalone test? http://buzztard.cvs.sourceforge.net/buzztard/buzztard/design/gui/accelpopup.c?view=markup The basic issue is that gtk_accel_map_add_entry() is not notifying the window if the accel_group is not added, so that needs to be done when adding it later. The removing does not seem to need it. The example works fine without.
(In reply to comment #5) > Why do you think so. because the set of keys supported on the window changed, so we need to rebuild our key hashes. it should also be clear from the signal name/semantics: "::keys-changed", i.e. notification needs to be emitted when the set of accels/mnemonics on a window changed. > The removing does not seem to need it. The example works fine without. the example doesn't exhaustively trigger all key related gtk bugs in the world ;)
Okay, I added it to gtk_window_remove_accel_group() as well and it seems to work fine. Can I commit this both to trunk and branch-2.10 ?
(In reply to comment #7) > Okay, I added it to gtk_window_remove_accel_group() as well and it seems to > work fine. Can I commit this both to trunk and branch-2.10 ? yes please, that's what i meant in comment #4 ;)
2007-08-27 Stefan Kost <ensonic@users.sf.net> * gtk/gtkwindow.c: Update menu accelerators, when adding/removing AccelGroups dynamically. (#469374)