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 624540 - GtkRadionAction loop in its activate handler
GtkRadionAction loop in its activate handler
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.90.x
Other Linux
: Normal major
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2010-07-16 14:33 UTC by Alban Browaeys
Modified: 2010-07-19 13:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
define and use a GtkToggleAction "direct" set instead of emitting unwillingly and event (2.84 KB, patch)
2010-07-16 14:33 UTC, Alban Browaeys
none Details | Review
Add _gtk_toggle_action_set_active() internal function (2.40 KB, patch)
2010-07-16 16:38 UTC, Javier Jardón (IRC: jjardon)
committed Details | Review

Description Alban Browaeys 2010-07-16 14:33:41 UTC
Created attachment 166023 [details] [review]
define and use a GtkToggleAction "direct" set instead of emitting unwillingly and event

Since commit 3ce68cd5dea2f720f01f9e30dc7289a4a628a4f9 "Use accessor functions to access GtkToggleAction" the Radio action activate is broken. Ie it is based on the assumption that the GtkToggleAction "set" does set the value not emit an event that calls the GtkAction activate handler (which here is not gtk_toggle action activate but the caller , ie gtk radio action activate. Thus this loops.

I made this locally as reverting to the old way is not possible (ie the structure of toggle_action is now opaque. That is define a GtkToggleAction "direct" set .
Comment 1 Javier Jardón (IRC: jjardon) 2010-07-16 16:38:14 UTC
Created attachment 166027 [details] [review]
Add _gtk_toggle_action_set_active() internal function

Another solution similar to the solution proposed in bug #624432
Comment 2 Emmanuele Bassi (:ebassi) 2010-07-19 12:02:45 UTC
Review of attachment 166027 [details] [review]:

it could be replaced by a flag inside GtkRadioAction, in order to check for cycles. as a stop-gap solution, though, it makes more sense to have a private internal setter.

::: gtk/gtktoggleaction.c
@@ +369,3 @@
+void
+
+

can you please document this internal setter?

something like:

/*
 * _gtk_toggle_action_set_active:
 * @toggle_action: a #GtkToggleAction
 * @is_active: whether the action is active or not
 *
 * Sets the :active property directly. This function does
 * not emit signals or notifications: it is left to the
 * caller to do so.
 */
Comment 3 Javier Jardón (IRC: jjardon) 2010-07-19 13:17:29 UTC
Comment on attachment 166027 [details] [review]
Add _gtk_toggle_action_set_active() internal function

committed with your comments

commit 1bfa931e2033e81d226483394a90cbbbe33a92b1
Comment 4 Javier Jardón (IRC: jjardon) 2010-07-19 13:17:47 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release.

Thank you for your bug report.