Commit 95caf23d authored by Matthias Clasen's avatar Matthias Clasen

Block the previous action when calling reset() to prevent accidental

       * gtk/gtkactivatable.c (gtk_activatable_do_set_related_action):
        Block the previous action when calling reset() to prevent
        accidental activation of the previous action.

        * gtk/gtkaction.c (gtk_action_activate): Don't compare booleans.

        * gtk/gtktoggleaction.c (gtk_toggle_action_set_active): Remove
        extraneous braces.


svn path=/trunk/; revision=22225
parent b7d09a27
2009-01-26 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkactivatable.c (gtk_activatable_do_set_related_action):
Block the previous action when calling reset() to prevent
accidental activation of the previous action.
* gtk/gtkaction.c (gtk_action_activate): Don't compare booleans.
* gtk/gtktoggleaction.c (gtk_toggle_action_set_active): Remove
extraneous braces.
2009-01-26 Bastien Nocera <hadess@hadess.net>
Bug 569240 - Crasher when using markers
......
......@@ -750,8 +750,10 @@ gtk_action_activate (GtkAction *action)
{
g_return_if_fail (GTK_IS_ACTION (action));
if (action->private_data->activate_blocked == FALSE &&
gtk_action_is_sensitive (action))
if (action->private_data->activate_blocked)
return;
if (gtk_action_is_sensitive (action))
_gtk_action_emit_activate (action);
}
......
......@@ -443,12 +443,16 @@ gtk_activatable_do_set_related_action (GtkActivatable *activatable,
_gtk_action_remove_from_proxy_list (prev_action, GTK_WIDGET (activatable));
g_object_unref (prev_action);
/* Some apps are using the object data directly...
* so continue to set it for a bit longer
*/
g_object_set_data (activatable, "gtk-action", NULL);
/*
* We don't want prev_action to be activated
* during the reset() call when syncing "active".
*/
gtk_action_block_activate (prev_action);
}
/* Some applications rely on their proxy UI to be set up
......@@ -457,6 +461,12 @@ gtk_activatable_do_set_related_action (GtkActivatable *activatable,
*/
gtk_activatable_reset (activatable, action);
if (prev_action)
{
gtk_action_unblock_activate (prev_action);
g_object_unref (prev_action);
}
if (action)
{
g_object_ref (action);
......
......@@ -267,9 +267,7 @@ gtk_toggle_action_set_active (GtkToggleAction *action,
is_active = is_active != FALSE;
if (action->private_data->active != is_active)
{
_gtk_action_emit_activate (GTK_ACTION (action));
}
_gtk_action_emit_activate (GTK_ACTION (action));
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment