mirror of https://github.com/GNOME/gimp.git
app: make gimp_prop_gui_chain_toggled() less error-prone.
Don't assume that "toggled" signal means that toggle status actually changed. Though issue #3133 got fixed with my previous commit, let's make sure we never create several GBinding for the same GimpChain by always checking existence of a previous one after a "toggled" signal. Also only create a GBinding object if one doesn't already exist.
This commit is contained in:
parent
03dc24455a
commit
9042e85f3c
|
@ -279,17 +279,18 @@ gimp_prop_gui_chain_toggled (GimpChainButton *chain,
|
|||
GBinding *binding;
|
||||
GtkAdjustment *y_adj;
|
||||
|
||||
binding = g_object_get_data (G_OBJECT (chain), "binding");
|
||||
y_adj = g_object_get_data (G_OBJECT (x_adj), "y-adjustment");
|
||||
|
||||
if (gimp_chain_button_get_active (chain))
|
||||
{
|
||||
if (! binding)
|
||||
binding = g_object_bind_property (x_adj, "value",
|
||||
y_adj, "value",
|
||||
G_BINDING_BIDIRECTIONAL);
|
||||
}
|
||||
else
|
||||
{
|
||||
binding = g_object_get_data (G_OBJECT (chain), "binding");
|
||||
g_clear_object (&binding);
|
||||
}
|
||||
g_object_set_data (G_OBJECT (chain), "binding", binding);
|
||||
|
|
Loading…
Reference in New Issue