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 469374 - menu accelerators don't work
menu accelerators don't work
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.10.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2007-08-22 20:01 UTC by Stefan Sauer (gstreamer, gtkdoc dev)
Modified: 2007-08-27 17:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
notify key changes (372 bytes, patch)
2007-08-22 20:02 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
rejected Details | Review
notify key changes (413 bytes, patch)
2007-08-23 10:29 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
committed Details | Review

Description Stefan Sauer (gstreamer, gtkdoc dev) 2007-08-22 20:01:05 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.
Comment 1 Stefan Sauer (gstreamer, gtkdoc dev) 2007-08-22 20:02:16 UTC
Created attachment 94144 [details] [review]
notify key changes
Comment 2 Tim Janik 2007-08-23 08:36:59 UTC
please make diffs with -up to spare everyone from re-diffing against SVN just to read your patch.
Comment 3 Stefan Sauer (gstreamer, gtkdoc dev) 2007-08-23 10:29:30 UTC
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
Comment 4 Tim Janik 2007-08-23 10:47:45 UTC
(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?
Comment 5 Stefan Sauer (gstreamer, gtkdoc dev) 2007-08-23 11:07:11 UTC
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.
Comment 6 Tim Janik 2007-08-23 11:18:02 UTC
(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 ;)
Comment 7 Stefan Sauer (gstreamer, gtkdoc dev) 2007-08-24 20:22:59 UTC
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 ?
Comment 8 Tim Janik 2007-08-27 09:50:56 UTC
(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 ;)
Comment 9 Stefan Sauer (gstreamer, gtkdoc dev) 2007-08-27 17:53:55 UTC
2007-08-27  Stefan Kost  <ensonic@users.sf.net>

	* gtk/gtkwindow.c: Update menu accelerators, when adding/removing
	AccelGroups dynamically. (#469374)