]> git.sur5r.net Git - i3/i3/blobdiff - src/handlers.c
Merge branch 'master' into next
[i3/i3] / src / handlers.c
index b78089db1eef3d3b6479476d6ceb9652c53a2697..00adc0e5ed62dd6a4f768c940835077169cc39b7 100644 (file)
@@ -819,18 +819,16 @@ static bool handle_hints(void *data, xcb_connection_t *conn, uint8_t state, xcb_
 
     xcb_icccm_wm_hints_t hints;
 
-    if (reply != NULL) {
-        if (!xcb_icccm_get_wm_hints_from_reply(&hints, reply))
+    if (reply == NULL)
+        if (!(reply = xcb_get_property_reply(conn, xcb_icccm_get_wm_hints(conn, window), NULL)))
             return false;
-    } else {
-        if (!xcb_icccm_get_wm_hints_reply(conn, xcb_icccm_get_wm_hints_unchecked(conn, con->window->id), &hints, NULL))
-            return false;
-    }
+
+    if (!xcb_icccm_get_wm_hints_from_reply(&hints, reply))
+        return false;
 
     if (!con->urgent && focused == con) {
         DLOG("Ignoring urgency flag for current client\n");
-        FREE(reply);
-        return true;
+        goto end;
     }
 
     /* Update the flag on the client directly */
@@ -846,7 +844,10 @@ static bool handle_hints(void *data, xcb_connection_t *conn, uint8_t state, xcb_
 
     tree_render();
 
-    FREE(reply);
+end:
+    if (con->window)
+        window_update_hints(con->window, reply);
+    else free(reply);
     return true;
 }