GNOME Bugzilla – Bug 137151
Accelerators of hidden menu bars are disabled with update to gtk+-2.4
Last modified: 2004-12-22 21:47:04 UTC
The image view does not get accelerators like +/- (zoom in/out) anymore when the gtk version is updated from 2.2.x to 2.3.x (soon to be 2.4). This can be considered as a gtk+ abi breakage but OTOH the accelerators function of Dia are not affected by the gtk+ update (maybe cause it's calling gtk_accel_group_new() at the right place itself ?). One prerequisite for The Gimp accelerators to not work anymore is to disable the image view menubar, i.e. they do work regardless of gtk version with the per image menubar switched on. The backend code for key handling on win32 did not change significant so I assume this to be a cross platform issue (or at least I don't know where to look next, even gtkaccel* and gtkitem* seem almost unchanged ;-) Any hint how to fix it (beside switching on the image menu bar) woud be appreciated. Thanks, Hans
Can this be verified on other platforms? IMO it should be reassigned to GTK+ because a GTK+ update should not break any working features. But then, we might be doing something nasty...
Confirmed to not work on X11 either.
Bug was originally reported against GIMP 2.0pre.
It's an intentional change and fixed a bunch of problems; I think it's a correct change too. Thu Nov 27 16:19:03 2003 Tim Janik <timj@gtk.org> * gtk/gtkmenu.c: allow accel activation depending on sensitivity and the attach widget. * gtk/gtkmenuitem.c: allow accel activation depending on visibility, sensitivity and the parent menu. * gtk/gtkwidget.[hc]: introduced ::can-activate-accel signal which checks whether accelerators may activate a widget. the default handler demands the widget be sensitive and visible+viewable. The only question is whether it is a *compatible* correct change, which I don't have a good answer for; was being able to activate accelerators on a hidden menu a bug or a feature? However, since we are at the release point, I'm going to have to say it was a bug; I don't want to switch this back at the last moment. You can work around this with a signal connection to can-activate-accel on your menubar.
I must say I agree that the new behavior makes more sense. We will have to add some runtime checks for the GTK version used anyway because I consider it impossible to keep GTK's behavior 100% the same given the huge amount of changes since 1.2. Will the same fix also be needed once we switched to GtkActionGroup?
For the record: added the described workaround in GIMP: 2004-03-19 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplayshell.c (gimp_display_shell_new): added runtime check for GTK+ >= 2.4.0 and make sure the menubar's accels can be invoked even if the menubar is invisible (workaround for bug #137151).
*** Bug 139507 has been marked as a duplicate of this bug. ***
*** Bug 137463 has been marked as a duplicate of this bug. ***