diff options
author | Anselm R. Garbe <arg@10kloc.org> | 2006-10-16 12:59:37 +0200 |
---|---|---|
committer | Anselm R. Garbe <arg@10kloc.org> | 2006-10-16 12:59:37 +0200 |
commit | 10ccc43597910428a22129cd942881835d95b5c0 (patch) | |
tree | 6426596582bf100c53b5c7f935ef10db60084f42 /slock.c | |
parent | 9fa696d6c13e64b5bdc9dd01e4965eccec4b23cf (diff) | |
download | slock-0.2.tar.gz slock-0.2.tar.xz |
added pointer grab0.2
Diffstat (limited to 'slock.c')
-rw-r--r-- | slock.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -63,9 +63,6 @@ main(int argc, char **argv) { /* init */ passwd[0] = 0; - while(XGrabKeyboard(dpy, RootWindow(dpy, screen), True, GrabModeAsync, - GrabModeAsync, CurrentTime) != GrabSuccess) - usleep(1000); wa.override_redirect = 1; wa.background_pixel = BlackPixel(dpy, screen); @@ -78,6 +75,11 @@ 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); + running = XGrabPointer(dpy, RootWindow(dpy, screen), False, + ButtonPressMask | ButtonReleaseMask | PointerMotionMask, + GrabModeAsync, GrabModeSync, None, invisible, CurrentTime) == GrabSuccess + && XGrabKeyboard(dpy, RootWindow(dpy, screen), True, GrabModeAsync, + GrabModeAsync, CurrentTime) == GrabSuccess; XMapRaised(dpy, w); XSync(dpy, False); @@ -119,6 +121,7 @@ main(int argc, char **argv) { break; } } + XUngrabPointer(dpy, CurrentTime); XFreePixmap(dpy, pmap); XDestroyWindow(dpy, w); XCloseDisplay(dpy); |