movecenter.c (326B)
1 void 2 movecenter(const Arg *arg) 3 { 4 Client *c = selmon->sel; 5 XEvent ev; 6 7 if (!c || !c->isfloating) 8 return; 9 10 c->x = c->mon->mx + (c->mon->mw - WIDTH(c)) / 2; 11 c->y = c->mon->my + (c->mon->mh - HEIGHT(c)) / 2; 12 XMoveWindow(dpy, c->win, c->x, c->y); 13 XSync(dpy, False); 14 while (XCheckMaskEvent(dpy, EnterWindowMask, &ev)); 15 }