diff options
author | Anselm R. Garbe <arg@suckless.org> | 2007-03-02 21:50:05 +0100 |
---|---|---|
committer | Anselm R. Garbe <arg@suckless.org> | 2007-03-02 21:50:05 +0100 |
commit | 8322f22871ee1da82546dfcdea484ef9db6d4942 (patch) | |
tree | f8c3a2b475dd5756732103473338244be5e63a21 | |
parent | d83a9a1d01fb70df9859ea231c8d7a2fb898c1e7 (diff) |
grab on the slock window instead on the root window
-rw-r--r-- | slock.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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 */ |