[hackers] [slock] grab on the root window, it is correct, all lockers do that

From: Anselm R. Garbe <arg_AT_suckless.org>
Date: Wed Mar 07 10:59:55 2007

changeset: 23:dd226a81c09a
tag: tip
user: Anselm R. Garbe <arg_AT_suckless.org>
date: Wed Mar 07 10:57:23 2007 +0100
summary: grab on the root window, it is correct, all lockers do that

diff -r c62861d0ab7c -r dd226a81c09a config.mk
--- a/config.mk Mon Mar 05 11:28:53 2007 +0100
+++ b/config.mk Wed Mar 07 10:57:23 2007 +0100
@@ -1,5 +1,5 @@
 # slock version
-VERSION = 0.5
+VERSION = 0.6
 
 # Customize below to fit your system
 
diff -r c62861d0ab7c -r dd226a81c09a slock.c
--- a/slock.c Mon Mar 05 11:28:53 2007 +0100
+++ b/slock.c Wed Mar 07 10:57:23 2007 +0100
@@ -81,21 +81,20 @@ main(int argc, char **argv) {
         w = XCreateWindow(dpy, root, 0, 0, DisplayWidth(dpy, screen), DisplayHeight(dpy, screen),
                         0, DefaultDepth(dpy, screen), CopyFromParent,
                         DefaultVisual(dpy, screen), CWOverrideRedirect | CWBackPixel, &wa);
-
         XAllocNamedColor(dpy, DefaultColormap(dpy, screen), "black", &black, &dummy);
         pmap = XCreateBitmapFromData(dpy, w, curs, 8, 8);
         invisible = XCreatePixmapCursor(dpy, pmap, pmap, &black, &black, 0, 0);
         XDefineCursor(dpy, w, invisible);
         XMapRaised(dpy, w);
         for(len = 1000; len; len--) {
- if(XGrabPointer(dpy, w, False, ButtonPressMask | ButtonReleaseMask | PointerMotionMask,
+ if(XGrabPointer(dpy, root, False, ButtonPressMask | ButtonReleaseMask | PointerMotionMask,
                         GrabModeAsync, GrabModeSync, None, invisible, CurrentTime) == GrabSuccess)
                         break;
                 usleep(1000);
         }
         if((running = running && (len > 0))) {
                 for(len = 1000; len; len--) {
- if(XGrabKeyboard(dpy, w, True, GrabModeAsync, GrabModeAsync, CurrentTime)
+ if(XGrabKeyboard(dpy, root, True, GrabModeAsync, GrabModeAsync, CurrentTime)
                                 == GrabSuccess)
                                 break;
                         usleep(1000);
Received on Wed Mar 07 2007 - 10:59:55 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:56:14 UTC