]> code.delx.au - spectrwm/commitdiff
convert a XGetWindowAttributes
authorDavid Hill <dhill@conformal.com>
Fri, 6 Jul 2012 04:22:58 +0000 (00:22 -0400)
committerReginald Kennedy <rk@rejii.com>
Fri, 20 Jul 2012 21:58:31 +0000 (05:58 +0800)
spectrwm.c

index d63e6e8accdd43e107241600dd4c1d12ff1eb80c..3367c2a79b1ab11d37884d23eca1cba4a32d93e2 100644 (file)
@@ -3223,7 +3223,6 @@ adjust_font(struct ws_win *win)
 void
 stack_master(struct workspace *ws, struct swm_geometry *g, int rot, int flip)
 {
-       XWindowAttributes       wa;
        struct swm_geometry     win_g, r_g = *g;
        struct ws_win           *win, *fs_win = NULL;
        int                     i, j, s, stacks;
@@ -3232,6 +3231,8 @@ stack_master(struct workspace *ws, struct swm_geometry *g, int rot, int flip)
        int                     split, colno, winno, mwin, msize, mscale;
        int                     remain, missing, v_slice, reconfigure;
        int                     bordered = 1;
+       xcb_get_window_attributes_cookie_t      wac;
+       xcb_get_window_attributes_reply_t       *war;
 
        DNPRINTF(SWM_D_STACK, "stack_master: workspace: %d, rot: %s, "
            "flip: %s\n", ws->idx, YESNO(rot), YESNO(flip));
@@ -3394,10 +3395,13 @@ stack_master(struct workspace *ws, struct swm_geometry *g, int rot, int flip)
                        update_window(win);
                }
 
-               if (XGetWindowAttributes(display, win->id, &wa))
-                       if (wa.map_state == IsUnmapped)
+               wac = xcb_get_window_attributes(conn, win->id);
+               war = xcb_get_window_attributes_reply(conn, wac, NULL);
+               if (war) {
+                       if (war->map_state == XCB_MAP_STATE_UNMAPPED)
                                map_window_raised(win->id);
-
+                       free(war);
+               }
                last_h = win_g.h;
                i++;
                j++;