]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkactivatable.c
Block the previous action when calling reset() to prevent accidental
[~andy/gtk] / gtk / gtkactivatable.c
index 8a09143856d2b568efc786764521eaeded412b20..198c8ba975571a5911531fcbccaad668a9007c14 100644 (file)
@@ -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);