From 8a7a68c4c09cbc8b03cb2765ac83e99ca1cc808b Mon Sep 17 00:00:00 2001 From: "Anselm R. Garbe" Date: Wed, 18 Oct 2006 18:44:19 +0200 Subject: applied somwhat similiar patch like Alex Elide proposed --- slock.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/slock.c b/slock.c index 72afd1e..164a464 100644 --- a/slock.c +++ b/slock.c @@ -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); -- cgit v1.2.3-70-g09d2