[wiki] [sites] Add patch for slock. || Arif Roktim

From: <git_AT_suckless.org>
Date: Thu, 26 Apr 2018 04:10:10 +0200

commit 3fc4a7de29541f8b45adbeeb9bfa2bb402359463
Author: Arif Roktim <aroktim_AT_stuy.edu>
Date: Wed Apr 25 22:07:17 2018 -0400

    Add patch for slock.
    
    This patch keeps the screen unlocked but keeps the input locked.
    That is, the screen is not affected by slock, but users will not
    be able to interact with the X session unless they enter the correct password.

diff --git a/tools.suckless.org/slock/patches/slock-unlock_screen-1.4.diff b/tools.suckless.org/slock/patches/slock-unlock_screen-1.4.diff
new file mode 100644
index 00000000..cc7c80e2
--- /dev/null
+++ b/tools.suckless.org/slock/patches/slock-unlock_screen-1.4.diff
_AT_@ -0,0 +1,41 @@
+From ccfc4c1ab41826b4bac99e53a844ca244fcfb330 Mon Sep 17 00:00:00 2001
+From: Arif Roktim <aroktim_AT_stuy.edu>
+Date: Wed, 25 Apr 2018 21:27:59 -0400
+Subject: [PATCH] Lock input but don't lock screen
+
+This patch keeps the screen unlocked but keeps the input locked.
+That is, the screen is not affected by slock, but users will not
+be able to interact with the X session unless they enter the correct password.
+
+There's a lot of extraneous code that can be removed since the goal is
+for input to be locked while at the same time allowing the screen to be
+updated and viewable. But this patch just works (tm) and I don't want to
+potentially introduce bugs.
+---
+ slock.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/slock.c b/slock.c
+index d2f0886..98f5d80 100644
+--- a/slock.c
++++ b/slock.c
+_AT_@ -254,7 +254,7 @@ lockscreen(Display *dpy, struct xrandr *rr, int screen)
+ ptgrab = XGrabPointer(dpy, lock->root, False,
+ ButtonPressMask | ButtonReleaseMask |
+ PointerMotionMask, GrabModeAsync,
+- GrabModeAsync, None, invisible, CurrentTime);
++ GrabModeAsync, None, None, CurrentTime);
+ }
+ if (kbgrab != GrabSuccess) {
+ kbgrab = XGrabKeyboard(dpy, lock->root, True,
+_AT_@ -263,7 +263,6 @@ lockscreen(Display *dpy, struct xrandr *rr, int screen)
+
+ /* input is grabbed: we can lock the screen */
+ if (ptgrab == GrabSuccess && kbgrab == GrabSuccess) {
+- XMapRaised(dpy, lock->win);
+ if (rr->active)
+ XRRSelectInput(dpy, lock->win, RRScreenChangeNotifyMask);
+
+--
+2.17.0
+
diff --git a/tools.suckless.org/slock/patches/unlock_screen.md b/tools.suckless.org/slock/patches/unlock_screen.md
new file mode 100644
index 00000000..bf4eeed1
--- /dev/null
+++ b/tools.suckless.org/slock/patches/unlock_screen.md
_AT_@ -0,0 +1,18 @@
+Unlock Screen
+=========
+
+Description
+-----------
+This patch keeps the screen unlocked but keeps the input locked.
+That is, the screen is not affected by slock, but users will not
+be able to interact with the X session unless they enter the correct password.
+
+Download
+--------
+
+* [slock-unlock_screen-1.4.diff](slock-unlock_screen-1.4.diff)
+
+Authors
+-------
+
+* Arif Roktim <[aroktim_AT_stuy.edu](mailto:aroktim_AT_stuy.edu)>
Received on Thu Apr 26 2018 - 04:10:10 CEST

This archive was generated by hypermail 2.3.0 : Thu Apr 26 2018 - 04:12:29 CEST