diff options
-rw-r--r-- | config.mk | 2 | ||||
-rw-r--r-- | slock.c | 5 |
2 files changed, 3 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | # slock version | 1 | # slock version |
2 | VERSION = 0.5 | 2 | VERSION = 0.6 |
3 | 3 | ||
4 | # Customize below to fit your system | 4 | # Customize below to fit your system |
5 | 5 | ||
@@ -81,21 +81,20 @@ main(int argc, char **argv) { | |||
81 | w = XCreateWindow(dpy, root, 0, 0, DisplayWidth(dpy, screen), DisplayHeight(dpy, screen), | 81 | w = XCreateWindow(dpy, root, 0, 0, DisplayWidth(dpy, screen), DisplayHeight(dpy, screen), |
82 | 0, DefaultDepth(dpy, screen), CopyFromParent, | 82 | 0, DefaultDepth(dpy, screen), CopyFromParent, |
83 | DefaultVisual(dpy, screen), CWOverrideRedirect | CWBackPixel, &wa); | 83 | DefaultVisual(dpy, screen), CWOverrideRedirect | CWBackPixel, &wa); |
84 | |||
85 | XAllocNamedColor(dpy, DefaultColormap(dpy, screen), "black", &black, &dummy); | 84 | XAllocNamedColor(dpy, DefaultColormap(dpy, screen), "black", &black, &dummy); |
86 | pmap = XCreateBitmapFromData(dpy, w, curs, 8, 8); | 85 | pmap = XCreateBitmapFromData(dpy, w, curs, 8, 8); |
87 | invisible = XCreatePixmapCursor(dpy, pmap, pmap, &black, &black, 0, 0); | 86 | invisible = XCreatePixmapCursor(dpy, pmap, pmap, &black, &black, 0, 0); |
88 | XDefineCursor(dpy, w, invisible); | 87 | XDefineCursor(dpy, w, invisible); |
89 | XMapRaised(dpy, w); | 88 | XMapRaised(dpy, w); |
90 | for(len = 1000; len; len--) { | 89 | for(len = 1000; len; len--) { |
91 | if(XGrabPointer(dpy, w, False, ButtonPressMask | ButtonReleaseMask | PointerMotionMask, | 90 | if(XGrabPointer(dpy, root, False, ButtonPressMask | ButtonReleaseMask | PointerMotionMask, |
92 | GrabModeAsync, GrabModeSync, None, invisible, CurrentTime) == GrabSuccess) | 91 | GrabModeAsync, GrabModeSync, None, invisible, CurrentTime) == GrabSuccess) |
93 | break; | 92 | break; |
94 | usleep(1000); | 93 | usleep(1000); |
95 | } | 94 | } |
96 | if((running = running && (len > 0))) { | 95 | if((running = running && (len > 0))) { |
97 | for(len = 1000; len; len--) { | 96 | for(len = 1000; len; len--) { |
98 | if(XGrabKeyboard(dpy, w, True, GrabModeAsync, GrabModeAsync, CurrentTime) | 97 | if(XGrabKeyboard(dpy, root, True, GrabModeAsync, GrabModeAsync, CurrentTime) |
99 | == GrabSuccess) | 98 | == GrabSuccess) |
100 | break; | 99 | break; |
101 | usleep(1000); | 100 | usleep(1000); |