diff options
author | Anselm R. Garbe <arg@suckless.org> | 2007-03-07 10:57:23 +0100 |
---|---|---|
committer | Anselm R. Garbe <arg@suckless.org> | 2007-03-07 10:57:23 +0100 |
commit | 48a7ab2225d1e53a8e0fd73bca975bb7695d1b06 (patch) | |
tree | 085ad67ddb3fd69ca053b9893c128ed3fa769953 /slock.c | |
parent | d8ea9368993538b132ac019859b37f4bbbf85962 (diff) | |
download | slock-48a7ab2225d1e53a8e0fd73bca975bb7695d1b06.tar.gz slock-48a7ab2225d1e53a8e0fd73bca975bb7695d1b06.tar.xz |
grab on the root window, it is correct, all lockers do that0.6
Diffstat (limited to 'slock.c')
-rw-r--r-- | slock.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -81,21 +81,20 @@ main(int argc, char **argv) { w = XCreateWindow(dpy, root, 0, 0, DisplayWidth(dpy, screen), DisplayHeight(dpy, screen), 0, DefaultDepth(dpy, screen), CopyFromParent, DefaultVisual(dpy, screen), CWOverrideRedirect | CWBackPixel, &wa); - XAllocNamedColor(dpy, DefaultColormap(dpy, screen), "black", &black, &dummy); 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, w, False, ButtonPressMask | ButtonReleaseMask | PointerMotionMask, + if(XGrabPointer(dpy, root, 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, w, True, GrabModeAsync, GrabModeAsync, CurrentTime) + if(XGrabKeyboard(dpy, root, True, GrabModeAsync, GrabModeAsync, CurrentTime) == GrabSuccess) break; usleep(1000); |