JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
convert another XGetWindowAttributes to xcb
authorDavid Hill <dhill@conformal.com>
Wed, 11 Jul 2012 05:19:08 +0000 (01:19 -0400)
committerReginald Kennedy <rk@rejii.com>
Fri, 20 Jul 2012 21:58:32 +0000 (05:58 +0800)
spectrwm.c

index 7420e87..dc418de 100644 (file)
@@ -7032,20 +7032,27 @@ maprequest(XEvent *e)
 {
        struct ws_win           *win;
        struct swm_region       *r;
-       XWindowAttributes       wa;
        XMapRequestEvent        *ev = &e->xmaprequest;
+       xcb_get_window_attributes_reply_t *war;
 
        DNPRINTF(SWM_D_EVENT, "maprequest: window: 0x%lx\n",
            e->xmaprequest.window);
 
-       if (!XGetWindowAttributes(display, ev->window, &wa))
+       war = xcb_get_window_attributes_reply(conn,
+               xcb_get_window_attributes(conn, ev->window),
+               NULL);
+       if (!war)
                return;
-       if (wa.override_redirect)
+       if (war->override_redirect) {
+               free(war);
                return;
+       }       
+       free(war);
 
        win = manage_window(e->xmaprequest.window);
-       if (win == NULL)
+       if (win == NULL) {
                return; /* can't happen */
+       }
 
        stack();