]> git.sur5r.net Git - i3/i3/blobdiff - src/handlers.c
Refactor the interface of commands.c
[i3/i3] / src / handlers.c
index a1f90ba626389a017a764334c480e63cdf4bccca..596d15a6e40f532afdff76623cc0eebe181b4ed9 100644 (file)
@@ -118,9 +118,12 @@ static void handle_key_press(xcb_key_press_event_t *event) {
         }
     }
 
-    char *json_result = parse_command(bind->command);
-    FREE(json_result);
-    return;
+    struct CommandResult *command_output = parse_command(bind->command);
+
+    if (command_output->needs_tree_render)
+        tree_render();
+
+    free(command_output->json_output);
 }
 
 /*
@@ -841,12 +844,20 @@ static bool handle_hints(void *data, xcb_connection_t *conn, uint8_t state, xcb_
 
     if (!con->urgent && focused == con) {
         DLOG("Ignoring urgency flag for current client\n");
+        con->window->urgent = 0;
         goto end;
     }
 
     /* Update the flag on the client directly */
     con->urgent = (xcb_icccm_wm_hints_get_urgency(&hints) != 0);
     //CLIENT_LOG(con);
+    if (con->window) {
+        if (con->urgent) {
+            con->window->urgent = time(NULL);
+        } else {
+            con->window->urgent = 0;
+        }
+    }
     LOG("Urgency flag changed to %d\n", con->urgent);
 
     Con *ws;