diff options
author | Anselm R. Garbe <arg@suckless.org> | 2006-10-18 18:44:19 +0200 |
---|---|---|
committer | Anselm R. Garbe <arg@suckless.org> | 2006-10-18 18:44:19 +0200 |
commit | 8a7a68c4c09cbc8b03cb2765ac83e99ca1cc808b (patch) | |
tree | 015244f0f5f1c0ceda3b0d7bd9932cee6abfd8b0 | |
parent | 6e53ce4582cc1cc338028c099108f6f225a7286d (diff) |
applied somwhat similiar patch like Alex Elide proposed
-rw-r--r-- | slock.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -77,9 +77,12 @@ main(int argc, char **argv) { 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; + GrabModeAsync, GrabModeSync, None, invisible, CurrentTime) == GrabSuccess; + len = 10; + for(len = 10; len && (XGrabKeyboard(dpy, RootWindow(dpy, screen), True, GrabModeAsync, + GrabModeAsync, CurrentTime) != GrabSuccess); len--) + usleep(1000); + running = running && (len > 0); XMapRaised(dpy, w); XSync(dpy, False); |