commit 8f791fe35a6a039ea91acb82a902a6dc217f8e3a
parent c643abd69945f125a54b69f22fc81d03145232cc
Author: agarraga <83713047+agarraga@users.noreply.github.com>
Date: Wed, 27 Nov 2024 19:15:57 +0000
[slock][patch][keep screen] Add patch
Keep the screen as is before lock, including keeping any moving parts
moving
Diffstat:
2 files changed, 66 insertions(+), 0 deletions(-)
diff --git a/tools.suckless.org/slock/patches/keep-screen/index.md b/tools.suckless.org/slock/patches/keep-screen/index.md
@@ -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@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
@@ -0,0 +1,51 @@
+From 0751fda0e682c1f60599a6e0afcd512861ee6297 Mon Sep 17 00:00:00 2001
+From: agarrigu <83713047+agarrigu@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
+@@ -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++) {
+@@ -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
+