aboutsummaryrefslogtreecommitdiffstats
path: root/modules/warptoclient/warptoclient.c
blob: fbedeaa24205893317c91bac4eb361d2b33276b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
void
warptoclient(Client *c)
{
  int x, y;
    
  if (!c) {
    XWarpPointer(dpy, None, root, 0, 0, 0, 0, selmon->wx + selmon->ww/2, selmon->wy + selmon->wh/2);
    return;
  }
    
  x = c->x + WIDTH(c) / 2;
  y = c->y + HEIGHT(c) / 2;
    
  XWarpPointer(dpy, None, root, 0, 0, 0, 0, x, y);
}