Fix interactive actions with the new action running code.
authorDana Jansens <danakj@orodu.net>
Thu, 4 Aug 2011 17:43:34 +0000 (13:43 -0400)
committerDana Jansens <danakj@orodu.net>
Sun, 16 Oct 2011 22:55:15 +0000 (18:55 -0400)
It was running the interactive action init code when running an interactive
action that is already running.

openbox/action.c

index e134a652739210680831e12cf508744d76992aa1..cbf150a065084c7571834b34d7e562fe85ab798a 100644 (file)
@@ -288,14 +288,16 @@ gboolean action_run(ObAction *act, const ObActionListRun *data,
     run_i = FALSE;
     if (action_is_interactive(act)) {
         ObActionRunFunc this_run = act->def->run;
-        ObActionRunFunc i_run = (current_i_act ?
-                                 current_i_act->def->run : NULL);
-
-        if (i_run && i_run != this_run)
-            action_interactive_cancel_act();
-        run_i = TRUE;
-        if (i_run != this_run && act->i_pre)
-            run_i = act->i_pre(data->mod_state, act->options);
+        ObActionRunFunc current_i_run = (current_i_act ?
+                                         current_i_act->def->run : NULL);
+
+        if (current_i_run != this_run) {
+            if (current_i_run)
+                action_interactive_cancel_act();
+            run_i = TRUE;
+            if (act->i_pre)
+                run_i = act->i_pre(data->mod_state, act->options);
+        }
     }
 
     run = TRUE;