]> git.sur5r.net Git - i3/i3/blobdiff - src/handlers.c
Refactor the interface of commands.c
[i3/i3] / src / handlers.c
index 507fffcf96a7ac52d8eb668eea528c81ca7afb86..596d15a6e40f532afdff76623cc0eebe181b4ed9 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * handlers.c: Small handlers for various events (keypresses, focus changes,
  *             …).
@@ -118,9 +118,12 @@ static void handle_key_press(xcb_key_press_event_t *event) {
         }
     }
 
-    char *json_result = parse_cmd(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;