]> Dogcows Code - chaz/openbox/commitdiff
set the interactive action to NULL before doing its cleanup phase
authorDana Jansens <danakj@orodu.net>
Tue, 18 May 2010 01:58:44 +0000 (21:58 -0400)
committerDana Jansens <danakj@orodu.net>
Tue, 18 May 2010 01:58:44 +0000 (21:58 -0400)
if the cleanup ends up cancelling the "current interactive action", it would
cause the end function to be called again, which sucks.  for instance if the
cleanup function uses the Focus action. this prevents the unwanted loop
into the interactive action cleanup.

openbox/actions.c

index 463962a25c26410a91f63f7874e3e9cb787f6af8..125084e8c5ee7c9e776ba60f0a9d40301b5556b7 100644 (file)
@@ -383,13 +383,19 @@ static gboolean actions_interactive_begin_act(ObActionsAct *act, guint state)
 static void actions_interactive_end_act(void)
 {
     if (interactive_act) {
+        ObActionsAct *ia = interactive_act;
+
+        /* set this to NULL first so the i_post() function can't cause this to
+           get called again (if it decides it wants to cancel any ongoing
+           interactive action). */
+        interactive_act = NULL;
+
         ungrab_keyboard();
 
-        if (interactive_act->i_post)
-            interactive_act->i_post(interactive_act->options);
+        if (ia->i_post)
+            ia->i_post(ia->options);
 
-        actions_act_unref(interactive_act);
-        interactive_act = NULL;
+        actions_act_unref(ia);
     }
 }
 
This page took 0.024445 seconds and 4 git commands to generate.