GNOME Bugzilla – Bug 751754
GtkSwitch: calling gtk_switch_set_active in the handler for notify::active gets stuck in a loop
Last modified: 2015-07-02 01:05:24 UTC
Created attachment 306443 [details] gtk switch example Small reproducer attached. In gtk-3.14 or newer, the program gets stuck in a loop and eventually crashes. This worked prior to gtk-3.14, so I assume it has something to do with the addition of the state property. I get the same behavior even if I surround the set_active call in calls to handler_block_by_func/handler_unblock_by_func.
I think you've filed this bug before, and yes, I see that behavior change too. What are you trying to do here ? If the switch is currently blocked, I would suggest to make it insensitive. If the change does not take immediate effect, that is exactly what the state property was introduced for.
(In reply to Matthias Clasen from comment #1) > What are you trying to do here ? If the switch is currently blocked, I would > suggest to make it insensitive. The switch starts a network service, and if starting the service fails then the handler resets the status of the switch. So the condition blocking the switch isn't known until the switch is used. > If the change does not take immediate > effect, that is exactly what the state property was introduced for. The state property would probably work for this, it's just frustrating that the addition of the state property effectively breaks the use of the active property.