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, 30 Sep 2012 16:00:15 +0000 (12:00 -0400)
It was running the interactive action init code when running an interactive
action that is already running.

openbox/action.c

index b77efe5f43515254c57c51fc4de172eb69b4cdd3..a056b6a932de3df2747094afd7cac34a826a7ddb 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;