]> git.lizzy.rs Git - bspwm.git/blobdiff - ewmh.c
When transferring a desktop, hide it
[bspwm.git] / ewmh.c
diff --git a/ewmh.c b/ewmh.c
index c06a39a1841dc99aaa1f916b50c3e677ffc4abc9..cf7b2060293562393ad1b92545137f9e5d4107ba 100644 (file)
--- a/ewmh.c
+++ b/ewmh.c
@@ -9,10 +9,9 @@
 
 void ewmh_init(void)
 {
-    ewmh = (xcb_ewmh_connection_t *) malloc(sizeof(xcb_ewmh_connection_t));
-    xcb_intern_atom_cookie_t *ewmh_cookies;
-    ewmh_cookies = xcb_ewmh_init_atoms(dpy, ewmh);
-    xcb_ewmh_init_atoms_replies(ewmh, ewmh_cookies, NULL);
+    ewmh = malloc(sizeof(xcb_ewmh_connection_t));
+    if (xcb_ewmh_init_atoms_replies(ewmh, xcb_ewmh_init_atoms(dpy, ewmh), NULL) == 0)
+        err("Can't initialize EWMH atoms.\n");
 }
 
 void ewmh_update_wm_name(void)
@@ -111,11 +110,12 @@ void ewmh_update_client_list(void)
 
     for (monitor_t *m = mon_head; m != NULL; m = m->next)
         for (desktop_t *d = m->desk_head; d != NULL; d = d->next)
-            for (node_t *n = first_extrema(d->root); n != NULL; n = next_leaf(n))
+            for (node_t *n = first_extrema(d->root); n != NULL; n = next_leaf(n, d->root))
                 wins[i++] = n->client->window;
 
     if (i != num_clients)
         return;
 
     xcb_ewmh_set_client_list(ewmh, default_screen, num_clients, wins);
+    xcb_ewmh_set_client_list_stacking(ewmh, default_screen, num_clients, wins);
 }