]> code.delx.au - spectrwm/commitdiff
make update_iconic() use xcb
authorDavid Hill <dhill@conformal.com>
Tue, 3 Jul 2012 20:17:16 +0000 (16:17 -0400)
committerReginald Kennedy <rk@rejii.com>
Fri, 20 Jul 2012 21:58:30 +0000 (05:58 +0800)
spectrwm.c

index 2bfd08762f2b0779afd5b9a2c7afacb6db1604f2..63e925ac7468e4ad4f73a48a5aad7da8e6039206 100644 (file)
@@ -650,19 +650,26 @@ get_property(Window id, Atom atom, long count, Atom type, unsigned long *nitems,
 void
 update_iconic(struct ws_win *win, int newv)
 {
-       int32_t v = newv;
-       Atom iprop;
+       int32_t                         v = newv;
+       xcb_atom_t                      iprop;
+       xcb_intern_atom_cookie_t        c;
+       xcb_intern_atom_reply_t         *r;
 
        win->iconic = newv;
 
-       iprop = XInternAtom(display, "_SWM_ICONIC", False);
-       if (!iprop)
+       c = xcb_intern_atom(conn, False, strlen("_SWM_ICONIC"), "_SWM_ICONIC");
+       r = xcb_intern_atom_reply(conn, c, NULL);
+       if (r) {
+               iprop = r->atom;
+               free(r);
+       } else
                return;
+               
        if (newv)
-               XChangeProperty(display, win->id, iprop, XA_INTEGER, 32,
-                   PropModeReplace, (unsigned char *)&v, 1);
+               xcb_change_property(conn, XCB_PROP_MODE_REPLACE, win->id,
+                       iprop, XCB_ATOM_INTEGER, 32, 1, &v);
        else
-               XDeleteProperty(display, win->id, iprop);
+               xcb_delete_property(conn, win->id, iprop);
 }
 
 int