gtk+ r22225 - in trunk: . gtk
- From: matthiasc svn gnome org
- To: svn-commits-list gnome org
- Subject: gtk+ r22225 - in trunk: . gtk
- Date: Tue, 27 Jan 2009 00:25:21 +0000 (UTC)
Author: matthiasc
Date: Tue Jan 27 00:25:21 2009
New Revision: 22225
URL: http://svn.gnome.org/viewvc/gtk+?rev=22225&view=rev
Log:
* 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.
Modified:
trunk/ChangeLog
trunk/gtk/gtkaction.c
trunk/gtk/gtkactivatable.c
trunk/gtk/gtktoggleaction.c
Modified: trunk/gtk/gtkaction.c
==============================================================================
--- trunk/gtk/gtkaction.c (original)
+++ trunk/gtk/gtkaction.c Tue Jan 27 00:25:21 2009
@@ -750,8 +750,10 @@
{
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);
}
Modified: trunk/gtk/gtkactivatable.c
==============================================================================
--- trunk/gtk/gtkactivatable.c (original)
+++ trunk/gtk/gtkactivatable.c Tue Jan 27 00:25:21 2009
@@ -443,12 +443,16 @@
_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_reset (activatable, action);
+ if (prev_action)
+ {
+ gtk_action_unblock_activate (prev_action);
+ g_object_unref (prev_action);
+ }
+
if (action)
{
g_object_ref (action);
Modified: trunk/gtk/gtktoggleaction.c
==============================================================================
--- trunk/gtk/gtktoggleaction.c (original)
+++ trunk/gtk/gtktoggleaction.c Tue Jan 27 00:25:21 2009
@@ -267,9 +267,7 @@
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));
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]