app: fix "active" state management in GimpToggleAction
gimp_toggle_action_real_toggle(): set "active" before emitting
"change-state" so we don't infinitely try to set the state in case of
a recursion.
gimp_toggle_action_toggle(): add notify("active") because it wasn't
done anywhere.
Fixes #9392
This commit is contained in:
parent
3a35974e3a
commit
82e4bf5792
1 changed files with 3 additions and 2 deletions
|
|
@ -106,7 +106,7 @@ gimp_toggle_action_class_init (GimpToggleActionClass *klass)
|
|||
toggle_class->toggle = gimp_toggle_action_real_toggle;
|
||||
|
||||
/**
|
||||
* GimpToggleAction:enabled:
|
||||
* GimpToggleAction:active:
|
||||
*
|
||||
* If @action state is currently active.
|
||||
*
|
||||
|
|
@ -211,9 +211,9 @@ gimp_toggle_action_real_toggle (GimpToggleAction *action)
|
|||
{
|
||||
gboolean value = gimp_toggle_action_get_active (action);
|
||||
|
||||
action->priv->active = ! value;
|
||||
gimp_action_emit_change_state (GIMP_ACTION (action),
|
||||
g_variant_new_boolean (! value));
|
||||
action->priv->active = ! value;
|
||||
|
||||
/* Toggling always works for the base class. */
|
||||
return TRUE;
|
||||
|
|
@ -227,6 +227,7 @@ gimp_toggle_action_toggle (GimpToggleAction *action)
|
|||
{
|
||||
g_signal_emit (action, gimp_toggle_action_signals[TOGGLED], 0);
|
||||
g_object_notify (G_OBJECT (action), "state");
|
||||
g_object_notify (G_OBJECT (action), "active");
|
||||
|
||||
gimp_action_history_action_activated (GIMP_ACTION (action));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue