From ae8cce24d3eb590c3cc810eb8487296ee1db0718 Mon Sep 17 00:00:00 2001 From: "Anselm R. Garbe" Date: Wed, 21 Feb 2007 21:25:53 +0100 Subject: made slock more aggressive, DenisG please recheck --- slock.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'slock.c') diff --git a/slock.c b/slock.c index 089b950..65722ea 100644 --- a/slock.c +++ b/slock.c @@ -86,13 +86,14 @@ 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, + for(len = 1000; len && (XGrabPointer(dpy, RootWindow(dpy, screen), False, ButtonPressMask | ButtonReleaseMask | PointerMotionMask, - GrabModeAsync, GrabModeSync, None, invisible, CurrentTime) == GrabSuccess; - len = 10; - for(len = 10; len && (XGrabKeyboard(dpy, RootWindow(dpy, screen), True, GrabModeAsync, + GrabModeAsync, GrabModeSync, None, invisible, CurrentTime) != GrabSuccess); len--) + usleep(1000); + running = running && (len > 0); + for(len = 1000; len && (XGrabKeyboard(dpy, RootWindow(dpy, screen), True, GrabModeAsync, GrabModeAsync, CurrentTime) != GrabSuccess); len--) - usleep(10000); + usleep(1000); running = running && (len > 0); len = 0; XMapRaised(dpy, w); -- cgit v1.2.3-70-g09d2