1
0
mirror of git://git.suckless.org/slock synced 2024-12-26 00:42:11 +00:00

made slock more aggressive, DenisG please recheck

This commit is contained in:
Anselm R. Garbe 2007-02-21 21:25:53 +01:00
parent 663fdb326a
commit ae8cce24d3
2 changed files with 7 additions and 6 deletions

View File

@ -1,5 +1,5 @@
# slock version # slock version
VERSION = 0.4 VERSION = 0.5
# Customize below to fit your system # Customize below to fit your system

11
slock.c
View File

@ -86,13 +86,14 @@ main(int argc, char **argv) {
pmap = XCreateBitmapFromData(dpy, w, curs, 8, 8); pmap = XCreateBitmapFromData(dpy, w, curs, 8, 8);
invisible = XCreatePixmapCursor(dpy, pmap, pmap, &black, &black, 0, 0); invisible = XCreatePixmapCursor(dpy, pmap, pmap, &black, &black, 0, 0);
XDefineCursor(dpy, w, invisible); XDefineCursor(dpy, w, invisible);
running = XGrabPointer(dpy, RootWindow(dpy, screen), False, for(len = 1000; len && (XGrabPointer(dpy, RootWindow(dpy, screen), False,
ButtonPressMask | ButtonReleaseMask | PointerMotionMask, ButtonPressMask | ButtonReleaseMask | PointerMotionMask,
GrabModeAsync, GrabModeSync, None, invisible, CurrentTime) == GrabSuccess; GrabModeAsync, GrabModeSync, None, invisible, CurrentTime) != GrabSuccess); len--)
len = 10; usleep(1000);
for(len = 10; len && (XGrabKeyboard(dpy, RootWindow(dpy, screen), True, GrabModeAsync, running = running && (len > 0);
for(len = 1000; len && (XGrabKeyboard(dpy, RootWindow(dpy, screen), True, GrabModeAsync,
GrabModeAsync, CurrentTime) != GrabSuccess); len--) GrabModeAsync, CurrentTime) != GrabSuccess); len--)
usleep(10000); usleep(1000);
running = running && (len > 0); running = running && (len > 0);
len = 0; len = 0;
XMapRaised(dpy, w); XMapRaised(dpy, w);