[wiki] [sites] [slock][patch][keep screen] Add patch || agarraga
commit 8f791fe35a6a039ea91acb82a902a6dc217f8e3a
Author: agarraga <83713047+agarraga_AT_users.noreply.github.com>
Date: Wed Nov 27 19:15:57 2024 +0000
[slock][patch][keep screen] Add patch
Keep the screen as is before lock, including keeping any moving parts
moving
diff --git a/tools.suckless.org/slock/patches/keep-screen/index.md b/tools.suckless.org/slock/patches/keep-screen/index.md
new file mode 100644
index 00000000..59d89736
--- /dev/null
+++ b/tools.suckless.org/slock/patches/keep-screen/index.md
_AT_@ -0,0 +1,15 @@
+Keep Screen
+================
+
+Description
+-----------
+Don't blank or change the screen in any way when locking. Any moving parts
+(e.g. oneko, sl) will keep moving.
+
+Download
+--------
+* [slock-keep_screen-2024-11-27-0751fda.diff](slock-keep_screen-2024-11-27-0751fda.diff)
+
+Authors
+-------
+* Alonso Garrigues <alons_AT_tuta.io>
diff --git a/tools.suckless.org/slock/patches/keep-screen/slock-keep_screen-2024-11-27-0751fda.diff b/tools.suckless.org/slock/patches/keep-screen/slock-keep_screen-2024-11-27-0751fda.diff
new file mode 100644
index 00000000..2f24704e
--- /dev/null
+++ b/tools.suckless.org/slock/patches/keep-screen/slock-keep_screen-2024-11-27-0751fda.diff
_AT_@ -0,0 +1,51 @@
+From 0751fda0e682c1f60599a6e0afcd512861ee6297 Mon Sep 17 00:00:00 2001
+From: agarrigu <83713047+agarrigu_AT_users.noreply.github.com>
+Date: Wed, 27 Nov 2024 18:59:56 +0000
+Subject: [PATCH] [slock][patch][keep screen] Add patch
+
+Don't create a background pixel or image, keep the screen as-is before
+lock (including keeping any moving parts moving)
+---
+ slock.c | 15 ++-------------
+ 1 file changed, 2 insertions(+), 13 deletions(-)
+
+diff --git a/slock.c b/slock.c
+index b2f14e3..19a688e 100644
+--- a/slock.c
++++ b/slock.c
+_AT_@ -188,15 +188,6 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens,
+ break;
+ }
+ color = len ? INPUT : ((failure || failonclear) ? FAILED : INIT);
+- if (running && oldc != color) {
+- for (screen = 0; screen < nscreens; screen++) {
+- XSetWindowBackground(dpy,
+- locks[screen]->win,
+- locks[screen]->colors[color]);
+- XClearWindow(dpy, locks[screen]->win);
+- }
+- oldc = color;
+- }
+ } else if (rr->active && ev.type == rr->evbase + RRScreenChangeNotify) {
+ rre = (XRRScreenChangeNotifyEvent*)&ev;
+ for (screen = 0; screen < nscreens; screen++) {
+_AT_@ -243,14 +234,12 @@ lockscreen(Display *dpy, struct xrandr *rr, int screen)
+
+ /* init */
+ wa.override_redirect = 1;
+- wa.background_pixel = lock->colors[INIT];
+ lock->win = XCreateWindow(dpy, lock->root, 0, 0,
+ DisplayWidth(dpy, lock->screen),
+ DisplayHeight(dpy, lock->screen),
+- 0, DefaultDepth(dpy, lock->screen),
+- CopyFromParent,
++ 0, 0, InputOnly,
+ DefaultVisual(dpy, lock->screen),
+- CWOverrideRedirect | CWBackPixel, &wa);
++ CWOverrideRedirect, &wa);
+ lock->pmap = XCreateBitmapFromData(dpy, lock->win, curs, 8, 8);
+ invisible = XCreatePixmapCursor(dpy, lock->pmap, lock->pmap,
+ &color, &color, 0, 0);
+--
+2.45.2
+
Received on Wed Nov 27 2024 - 20:18:06 CET
This archive was generated by hypermail 2.3.0
: Wed Nov 27 2024 - 20:24:53 CET