+ ws_idx_atom = XInternAtom(display, "_SWM_WS", False);
+ if (ws_idx_atom)
+ XGetWindowProperty(display, id, ws_idx_atom, 0, 1, False, XA_STRING,
+ &type, &format, &nitems, &bytes, &prop);
+
+ XGetWindowAttributes(display, id, &win->wa);
+ r = root_to_region(win->wa.root);
+ /* If the window was managed before, put it in the same workspace */
+ if (prop)
+ ws = &r->s->ws[prop[0]];
+ else
+ ws = r->ws;
+