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 118906 - key accelerator in popup menu
key accelerator in popup menu
Status: RESOLVED WONTFIX
Product: libglade
Classification: Deprecated
Component: gtk
CVS HEAD
Other Linux
: Normal normal
: ---
Assigned To: James Henstridge
James Henstridge
Depends on:
Blocks: 153594
 
 
Reported: 2003-08-01 20:23 UTC by hilaire
Modified: 2011-07-19 23:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
popup-accel.tar.gz (1.52 KB, application/x-compressed-tar)
2004-09-25 15:25 UTC, Bastien Nocera
Details

Description hilaire 2003-08-01 20:23:29 UTC
key accelerator in popup menu does not work. My application even
crashes when I have keyboard accelerator defined in the popup menu.
Comment 1 Bastien Nocera 2004-09-25 15:21:17 UTC
Key accelerators are not shown in popup menus with my version of libglade either.

gtk2-2.4.7-2.5
libglade2-2.3.6-1 (same happens with current HEAD, latest ChangeLog entry
2004-09-23)

Test case attached below.
Compile with:
gcc -Wall -o test `pkg-config --cflags --libs libglade-2.0 gtk+-2.0
libgnomeui-2.0` test.c
Run "./test" and click on the "Click Me!" button, you'll see the warning, and
the accelerator being set to "-/-".

$ ./test
** Message: button pressed
 
(test:17375): Gtk-CRITICAL **: file gtkaccelgroup.c: line 267
(gtk_accel_group_find): assertion `GTK_IS_ACCEL_GROUP (accel_group)' failed
Comment 2 Bastien Nocera 2004-09-25 15:25:09 UTC
Created attachment 31937 [details]
popup-accel.tar.gz
Comment 3 James Henstridge 2005-03-08 12:41:32 UTC
Sorry about not replying to this earlier -- I had no idea what would be causing
the problem, and didn't get round to investigating.

The answer to this question may simply be "don't do that" :)

When libglade is building a user interface, it creates a new accel group for
each toplevel.  So a popup menu defined like this will have its accelerators
registered in a new group.  This accel group isn't being referenced anywhere
else, so gets freed when libglade moves on to the next window.

Now, since it is a separate accel group, none of the accelerators will actually
be available in any of the other toplevels.  Automatically adding the accel
group to other toplevels would be a problem for the case where a glade file
contains more than one toplevel window (which one(s) do you add it to?).

The warning seems to be a bug in GtkAccelGroup where it doesn't handle the accel
group for the closure it is watching disappearing from under it (and it doesn't
hold a reference to it either).
Comment 4 Fabio Durán Verdugo 2011-07-19 23:27:09 UTC
The GNOME Release team has officially deprecated libglade in favor of GtkBuilder[1]. So it's unlikely to get further development. I am closing bugs as WONTFIX. Please feel free to reopen the bugs in future if anyone takes the responsibility for active development.

[1] http://permalink.gmane.org/gmane.comp.gnome.devel.announce/28