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 429970 - AccelLabel does not reference AccelGroup
AccelLabel does not reference AccelGroup
Status: RESOLVED WONTFIX
Product: gtk+
Classification: Platform
Component: Class: UIManager / Actions
2.10.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks: 386180
 
 
Reported: 2007-04-15 13:30 UTC by Armin Burgmeier
Modified: 2014-08-30 05:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Testcase (2.01 KB, text/x-csrc)
2007-04-15 13:32 UTC, Armin Burgmeier
  Details
Proposed patch (1.29 KB, patch)
2007-04-15 13:33 UTC, Armin Burgmeier
rejected Details | Review

Description Armin Burgmeier 2007-04-15 13:30:28 UTC
GtkAccelLabel does not add a reference to the AccelGroup obtained from the accel closure. This leads to invalid g_signal_handlers_disconnect calls when the closure is unset from the AccelLabel and the group does not exist anymore. This happens when an ActionGroup is shared between multiple UI managers.
Comment 1 Armin Burgmeier 2007-04-15 13:32:12 UTC
Created attachment 86379 [details]
Testcase

Testcase that uses a single ActionGroup for multiple UI managers. This prints warnings on the screen when the window (and with it the AccelLabels of the menu) are destroyed.
Comment 2 Armin Burgmeier 2007-04-15 13:33:11 UTC
Created attachment 86381 [details] [review]
Proposed patch

Adds an extra reference to the AccelGroup.
Comment 3 Murray Cumming 2007-05-01 20:43:48 UTC
May we commit this? It fixes a crash in the gtkmm wrapper.
Comment 4 Matthias Clasen 2007-05-01 22:50:26 UTC
I don't think this fix does the right thing. Sharing actions (or action groups)
between ui managers is not going to work correctly anyway. If you look at gtk_action_set_accel_group(), the actions accelerator will be associated randomly with one of the ui managers accel_group.
Comment 5 Murray Cumming 2007-05-05 16:13:23 UTC
Armin, does our original gtkmm test case use multiple UIManagers? If so, what is the person trying to achieve?
Comment 6 Armin Burgmeier 2007-05-05 19:15:28 UTC
Yes, it does. The point is to put the same menu/toolbar (well, actually, menus with the same actions) into multiple windows.
Comment 7 Murray Cumming 2007-05-07 07:55:57 UTC
But I guess this could be achieved by using one UIManager and one UI description, containing menu and toolbar descriptions that use the same action names.

If the submitter's technique should not be allowed, I guess we should add a g_warning() to prevent it.
Comment 8 Tim Janik 2007-06-15 00:50:05 UTC
(In reply to comment #2)
> Created an attachment (id=86381) [edit]
> Proposed patch
> 
> Adds an extra reference to the AccelGroup.

[not commenting on the UI manager issue]
the accel label shouldn't need to forefully keep an accel group alive, if this really needs fixing on the accel label side, you can use g_signal_connect_data() instead + a destroy handler that resets accel_label->accel_group to NULL.
Comment 9 Matthias Clasen 2014-08-30 05:07:49 UTC
GtkAction has been deprecated