--- pointer-lock.c 2011-01-30 13:01:37.396999981 +0000 +++ pointer-lock2.c 2011-01-30 13:09:44.834999934 +0000 @@ -2,6 +2,8 @@ pointerlock(const Arg *a) { if(a->i){ + if(!selmon->sel) + return; if(XGrabPointer(dpy, selmon->sel->win, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, selmon->sel->win, None, CurrentTime) != GrabSuccess)