diff options
-rw-r--r-- | slock.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -77,9 +77,12 @@ main(int argc, char **argv) { | |||
77 | XDefineCursor(dpy, w, invisible); | 77 | XDefineCursor(dpy, w, invisible); |
78 | running = XGrabPointer(dpy, RootWindow(dpy, screen), False, | 78 | running = XGrabPointer(dpy, RootWindow(dpy, screen), False, |
79 | ButtonPressMask | ButtonReleaseMask | PointerMotionMask, | 79 | ButtonPressMask | ButtonReleaseMask | PointerMotionMask, |
80 | GrabModeAsync, GrabModeSync, None, invisible, CurrentTime) == GrabSuccess | 80 | GrabModeAsync, GrabModeSync, None, invisible, CurrentTime) == GrabSuccess; |
81 | && XGrabKeyboard(dpy, RootWindow(dpy, screen), True, GrabModeAsync, | 81 | len = 10; |
82 | GrabModeAsync, CurrentTime) == GrabSuccess; | 82 | for(len = 10; len && (XGrabKeyboard(dpy, RootWindow(dpy, screen), True, GrabModeAsync, |
83 | GrabModeAsync, CurrentTime) != GrabSuccess); len--) | ||
84 | usleep(1000); | ||
85 | running = running && (len > 0); | ||
83 | XMapRaised(dpy, w); | 86 | XMapRaised(dpy, w); |
84 | XSync(dpy, False); | 87 | XSync(dpy, False); |
85 | 88 | ||