]> git.sur5r.net Git - i3/i3/blobdiff - src/assignments.c
Refactor the interface of commands.c
[i3/i3] / src / assignments.c
index 05da75546a39636f1939682f9d4a005b792d5bb1..eae87272a3c6bb746eb0102ebb4926bd436b68e3 100644 (file)
@@ -41,9 +41,13 @@ void run_assignments(i3Window *window) {
             DLOG("execute command %s\n", current->dest.command);
             char *full_command;
             sasprintf(&full_command, "[id=\"%d\"] %s", window->id, current->dest.command);
-            char *json_result = parse_command(full_command);
-            FREE(full_command);
-            FREE(json_result);
+            struct CommandResult *command_output = parse_command(full_command);
+            free(full_command);
+
+            if (command_output->needs_tree_render)
+                tree_render();
+
+            free(command_output->json_output);
         }
 
         /* Store that we ran this assignment to not execute it again */