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
This commit is contained in:
11
ChangeLog
11
ChangeLog
@ -1,3 +1,14 @@
|
|||||||
|
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>
|
2009-01-26 Bastien Nocera <hadess@hadess.net>
|
||||||
|
|
||||||
Bug 569240 - Crasher when using markers
|
Bug 569240 - Crasher when using markers
|
||||||
|
@ -750,8 +750,10 @@ gtk_action_activate (GtkAction *action)
|
|||||||
{
|
{
|
||||||
g_return_if_fail (GTK_IS_ACTION (action));
|
g_return_if_fail (GTK_IS_ACTION (action));
|
||||||
|
|
||||||
if (action->private_data->activate_blocked == FALSE &&
|
if (action->private_data->activate_blocked)
|
||||||
gtk_action_is_sensitive (action))
|
return;
|
||||||
|
|
||||||
|
if (gtk_action_is_sensitive (action))
|
||||||
_gtk_action_emit_activate (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));
|
_gtk_action_remove_from_proxy_list (prev_action, GTK_WIDGET (activatable));
|
||||||
|
|
||||||
g_object_unref (prev_action);
|
|
||||||
|
|
||||||
/* Some apps are using the object data directly...
|
/* Some apps are using the object data directly...
|
||||||
* so continue to set it for a bit longer
|
* so continue to set it for a bit longer
|
||||||
*/
|
*/
|
||||||
g_object_set_data (activatable, "gtk-action", NULL);
|
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
|
/* 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);
|
gtk_activatable_reset (activatable, action);
|
||||||
|
|
||||||
|
if (prev_action)
|
||||||
|
{
|
||||||
|
gtk_action_unblock_activate (prev_action);
|
||||||
|
g_object_unref (prev_action);
|
||||||
|
}
|
||||||
|
|
||||||
if (action)
|
if (action)
|
||||||
{
|
{
|
||||||
g_object_ref (action);
|
g_object_ref (action);
|
||||||
|
@ -267,9 +267,7 @@ gtk_toggle_action_set_active (GtkToggleAction *action,
|
|||||||
is_active = is_active != FALSE;
|
is_active = is_active != FALSE;
|
||||||
|
|
||||||
if (action->private_data->active != is_active)
|
if (action->private_data->active != is_active)
|
||||||
{
|
_gtk_action_emit_activate (GTK_ACTION (action));
|
||||||
_gtk_action_emit_activate (GTK_ACTION (action));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user