]> git.sur5r.net Git - i3/i3/blobdiff - src/con.c
t/*ewmh*: fix flakiness by syncing
[i3/i3] / src / con.c
index 7934133e6f96248d6411da9247976a62c45a97e3..282c389f694c78e1a735fa193e2bcb9172ecca37 100644 (file)
--- a/src/con.c
+++ b/src/con.c
  */
 #include "all.h"
 
-char *colors[] = {
-    "#ff0000",
-    "#00FF00",
-    "#0000FF",
-    "#ff00ff",
-    "#00ffff",
-    "#ffff00",
-    "#aa0000",
-    "#00aa00",
-    "#0000aa",
-    "#aa00aa"};
-
 static void con_on_remove_child(Con *con);
 
 /*
@@ -59,16 +47,7 @@ Con *con_new_skeleton(Con *parent, i3Window *window) {
         new->depth = window->depth;
     else
         new->depth = XCB_COPY_FROM_PARENT;
-    static int cnt = 0;
-    DLOG("opening window %d\n", cnt);
-
-    /* TODO: remove window coloring after test-phase */
-    DLOG("color %s\n", colors[cnt]);
-    new->name = strdup(colors[cnt]);
-    //uint32_t cp = get_colorpixel(colors[cnt]);
-    cnt++;
-    if ((cnt % (sizeof(colors) / sizeof(char *))) == 0)
-        cnt = 0;
+    DLOG("opening window\n");
 
     TAILQ_INIT(&(new->floating_head));
     TAILQ_INIT(&(new->nodes_head));
@@ -231,6 +210,7 @@ void con_focus(Con *con) {
         con->urgent = false;
         con_update_parents_urgency(con);
         workspace_update_urgent_flag(con_get_workspace(con));
+        ipc_send_window_event("urgent", con);
     }
 }
 
@@ -1599,14 +1579,16 @@ void con_set_urgency(Con *con, bool urgent) {
 
     con_update_parents_urgency(con);
 
-    if (con->urgent == urgent)
-        LOG("Urgency flag changed to %d\n", con->urgent);
-
     Con *ws;
     /* Set the urgency flag on the workspace, if a workspace could be found
      * (for dock clients, that is not the case). */
     if ((ws = con_get_workspace(con)) != NULL)
         workspace_update_urgent_flag(ws);
+
+    if (con->urgent == urgent) {
+        LOG("Urgency flag changed to %d\n", con->urgent);
+        ipc_send_window_event("urgent", con);
+    }
 }
 
 /*