aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--slock.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/slock.c b/slock.c
index ba75493..97a80c5 100644
--- a/slock.c
+++ b/slock.c
@@ -86,15 +86,16 @@ 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 XMapRaised(dpy, w);
89 for(len = 1000; len; len--) { 90 for(len = 1000; len; len--) {
90 if(XGrabPointer(dpy, root, False, ButtonPressMask | ButtonReleaseMask | PointerMotionMask, 91 if(XGrabPointer(dpy, w, False, ButtonPressMask | ButtonReleaseMask | PointerMotionMask,
91 GrabModeAsync, GrabModeSync, None, invisible, CurrentTime) == GrabSuccess) 92 GrabModeAsync, GrabModeSync, None, invisible, CurrentTime) == GrabSuccess)
92 break; 93 break;
93 usleep(1000); 94 usleep(1000);
94 } 95 }
95 if((running = running && (len > 0))) { 96 if((running = running && (len > 0))) {
96 for(len = 1000; len; len--) { 97 for(len = 1000; len; len--) {
97 if(XGrabKeyboard(dpy, root, True, GrabModeAsync, GrabModeAsync, CurrentTime) 98 if(XGrabKeyboard(dpy, w, True, GrabModeAsync, GrabModeAsync, CurrentTime)
98 == GrabSuccess) 99 == GrabSuccess)
99 break; 100 break;
100 usleep(1000); 101 usleep(1000);
@@ -102,7 +103,6 @@ main(int argc, char **argv) {
102 running = (len > 0); 103 running = (len > 0);
103 } 104 }
104 len = 0; 105 len = 0;
105 XMapRaised(dpy, w);
106 XSync(dpy, False); 106 XSync(dpy, False);
107 107
108 /* main event loop */ 108 /* main event loop */