diff options
author | Anselm R. Garbe <arg@suckless.org> | 2007-03-02 21:50:05 +0100 |
---|---|---|
committer | Anselm R. Garbe <arg@suckless.org> | 2007-03-02 21:50:05 +0100 |
commit | 8322f22871ee1da82546dfcdea484ef9db6d4942 (patch) | |
tree | f8c3a2b475dd5756732103473338244be5e63a21 /slock.c | |
parent | d83a9a1d01fb70df9859ea231c8d7a2fb898c1e7 (diff) | |
download | slock-0.5.tar.gz slock-0.5.tar.xz |
grab on the slock window instead on the root window0.5
Diffstat (limited to 'slock.c')
-rw-r--r-- | slock.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -86,15 +86,16 @@ main(int argc, char **argv) { pmap = XCreateBitmapFromData(dpy, w, curs, 8, 8); invisible = XCreatePixmapCursor(dpy, pmap, pmap, &black, &black, 0, 0); XDefineCursor(dpy, w, invisible); + XMapRaised(dpy, w); for(len = 1000; len; len--) { - if(XGrabPointer(dpy, root, False, ButtonPressMask | ButtonReleaseMask | PointerMotionMask, + if(XGrabPointer(dpy, w, False, ButtonPressMask | ButtonReleaseMask | PointerMotionMask, GrabModeAsync, GrabModeSync, None, invisible, CurrentTime) == GrabSuccess) break; usleep(1000); } if((running = running && (len > 0))) { for(len = 1000; len; len--) { - if(XGrabKeyboard(dpy, root, True, GrabModeAsync, GrabModeAsync, CurrentTime) + if(XGrabKeyboard(dpy, w, True, GrabModeAsync, GrabModeAsync, CurrentTime) == GrabSuccess) break; usleep(1000); @@ -102,7 +103,6 @@ main(int argc, char **argv) { running = (len > 0); } len = 0; - XMapRaised(dpy, w); XSync(dpy, False); /* main event loop */ |