Introduction
Introduction Statistics Contact Development Disclaimer Help
added pointer grab - slock - simple X display locker utility
git clone git://git.suckless.org/slock
Log
Files
Refs
README
LICENSE
---
commit 10ccc43597910428a22129cd942881835d95b5c0
parent 9fa696d6c13e64b5bdc9dd01e4965eccec4b23cf
Author: Anselm R. Garbe <[email protected]>
Date: Mon, 16 Oct 2006 12:59:37 +0200
added pointer grab
Diffstat:
M config.mk | 2 +-
M slock.c | 9 ++++++---
2 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/config.mk b/config.mk
@@ -1,5 +1,5 @@
# slock version
-VERSION = 0.1
+VERSION = 0.2
# Customize below to fit your system
diff --git a/slock.c b/slock.c
@@ -63,9 +63,6 @@ main(int argc, char **argv) {
/* init */
passwd[0] = 0;
- while(XGrabKeyboard(dpy, RootWindow(dpy, screen), True, GrabModeAsync,
- GrabModeAsync, CurrentTime) != GrabSuccess)
- usleep(1000);
wa.override_redirect = 1;
wa.background_pixel = BlackPixel(dpy, screen);
@@ -78,6 +75,11 @@ main(int argc, char **argv) {
pmap = XCreateBitmapFromData(dpy, w, curs, 8, 8);
invisible = XCreatePixmapCursor(dpy, pmap, pmap, &black, &black, 0, 0);
XDefineCursor(dpy, w, invisible);
+ running = XGrabPointer(dpy, RootWindow(dpy, screen), False,
+ ButtonPressMask | ButtonReleaseMask | PointerMotionMas…
+ GrabModeAsync, GrabModeSync, None, invisible, CurrentT…
+ && XGrabKeyboard(dpy, RootWindow(dpy, screen), True, GrabModeA…
+ GrabModeAsync, CurrentTime) == GrabSuccess;
XMapRaised(dpy, w);
XSync(dpy, False);
@@ -119,6 +121,7 @@ main(int argc, char **argv) {
break;
}
}
+ XUngrabPointer(dpy, CurrentTime);
XFreePixmap(dpy, pmap);
XDestroyWindow(dpy, w);
XCloseDisplay(dpy);
You are viewing proxied material from suckless.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.