diff options
author | Anselm R. Garbe <arg@suckless.org> | 2007-02-21 21:25:53 +0100 |
---|---|---|
committer | Anselm R. Garbe <arg@suckless.org> | 2007-02-21 21:25:53 +0100 |
commit | ae8cce24d3eb590c3cc810eb8487296ee1db0718 (patch) | |
tree | c9adffa0d01517cb62ef5e5939ac71a66ce9c3d8 | |
parent | 663fdb326a573ed8e4a5e47a6d8459b2f479b75f (diff) |
made slock more aggressive, DenisG please recheck
-rw-r--r-- | config.mk | 2 | ||||
-rw-r--r-- | slock.c | 11 |
2 files changed, 7 insertions, 6 deletions
@@ -1,5 +1,5 @@ | |||
1 | # slock version | 1 | # slock version |
2 | VERSION = 0.4 | 2 | VERSION = 0.5 |
3 | 3 | ||
4 | # Customize below to fit your system | 4 | # Customize below to fit your system |
5 | 5 | ||
@@ -86,13 +86,14 @@ main(int argc, char **argv) { | |||
86 | pmap = XCreateBitmapFromData(dpy, w, curs, 8, 8); | 86 | pmap = XCreateBitmapFromData(dpy, w, curs, 8, 8); |
87 | invisible = XCreatePixmapCursor(dpy, pmap, pmap, &black, &black, 0, 0); | 87 | invisible = XCreatePixmapCursor(dpy, pmap, pmap, &black, &black, 0, 0); |
88 | XDefineCursor(dpy, w, invisible); | 88 | XDefineCursor(dpy, w, invisible); |
89 | running = XGrabPointer(dpy, RootWindow(dpy, screen), False, | 89 | for(len = 1000; len && (XGrabPointer(dpy, RootWindow(dpy, screen), False, |
90 | ButtonPressMask | ButtonReleaseMask | PointerMotionMask, | 90 | ButtonPressMask | ButtonReleaseMask | PointerMotionMask, |
91 | GrabModeAsync, GrabModeSync, None, invisible, CurrentTime) == GrabSuccess; | 91 | GrabModeAsync, GrabModeSync, None, invisible, CurrentTime) != GrabSuccess); len--) |
92 | len = 10; | 92 | usleep(1000); |
93 | for(len = 10; len && (XGrabKeyboard(dpy, RootWindow(dpy, screen), True, GrabModeAsync, | 93 | running = running && (len > 0); |
94 | for(len = 1000; len && (XGrabKeyboard(dpy, RootWindow(dpy, screen), True, GrabModeAsync, | ||
94 | GrabModeAsync, CurrentTime) != GrabSuccess); len--) | 95 | GrabModeAsync, CurrentTime) != GrabSuccess); len--) |
95 | usleep(10000); | 96 | usleep(1000); |
96 | running = running && (len > 0); | 97 | running = running && (len > 0); |
97 | len = 0; | 98 | len = 0; |
98 | XMapRaised(dpy, w); | 99 | XMapRaised(dpy, w); |