- if (XGetWindowProperty(display, win,
- XInternAtom(display, "_SWM_PID", False), 0, SWM_PROPLEN, False,
- XA_STRING, &actual_type_return, &actual_format_return,
- &nitems_return, &bytes_after_return, &prop) != Success)
- return (0);
- if (actual_type_return != XA_STRING)
+ c = xcb_intern_atom(conn, False, strlen("_SWM_PID"), "_SWM_PID");
+ r = xcb_intern_atom_reply(conn, c, NULL);
+ if (r) {
+ apid = r->atom;
+ free(r);
+ }
+ pc = xcb_get_property(conn, False, win, apid, XCB_ATOM_STRING,
+ 0, SWM_PROPLEN);
+ pr = xcb_get_property_reply(conn, pc, NULL);
+ if (!pr)