xmonad: patch slock to include window title
needed for reliable focus exclusion from picom, so that screen contents aren't leaked while locked.
This commit is contained in:
parent
8ae4b62d77
commit
1efc3eab51
3 changed files with 31 additions and 1 deletions
4
overlays/slock.nix
Normal file
4
overlays/slock.nix
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
final: prev: {
|
||||||
|
slock = prev.slock.overrideAttrs
|
||||||
|
(o: { patches = [ ../pkgs/misc/screensavers/slock/window_name.patch ]; });
|
||||||
|
}
|
26
pkgs/misc/screensavers/slock/window_name.patch
Normal file
26
pkgs/misc/screensavers/slock/window_name.patch
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
diff --git a/slock.c b/slock.c
|
||||||
|
index d2f0886..b0418f0 100644
|
||||||
|
--- a/slock.c
|
||||||
|
+++ b/slock.c
|
||||||
|
@@ -219,8 +219,13 @@ lockscreen(Display *dpy, struct xrandr *rr, int screen)
|
||||||
|
struct lock *lock;
|
||||||
|
XColor color, dummy;
|
||||||
|
XSetWindowAttributes wa;
|
||||||
|
+ XTextProperty title;
|
||||||
|
+ char *name = "slock";
|
||||||
|
Cursor invisible;
|
||||||
|
|
||||||
|
+ if (XStringListToTextProperty(&name, 1, &title) == 0)
|
||||||
|
+ die("slock: out of memory\n");
|
||||||
|
+
|
||||||
|
if (dpy == NULL || screen < 0 || !(lock = malloc(sizeof(struct lock))))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
@@ -243,6 +248,7 @@ lockscreen(Display *dpy, struct xrandr *rr, int screen)
|
||||||
|
CopyFromParent,
|
||||||
|
DefaultVisual(dpy, lock->screen),
|
||||||
|
CWOverrideRedirect | CWBackPixel, &wa);
|
||||||
|
+ XSetWMName(dpy, lock->win, &title);
|
||||||
|
lock->pmap = XCreateBitmapFromData(dpy, lock->win, curs, 8, 8);
|
||||||
|
invisible = XCreatePixmapCursor(dpy, lock->pmap, lock->pmap,
|
||||||
|
&color, &color, 0, 0);
|
|
@ -20,7 +20,7 @@
|
||||||
inactiveOpacity = "0.8";
|
inactiveOpacity = "0.8";
|
||||||
settings = {
|
settings = {
|
||||||
"unredir-if-possible" = true;
|
"unredir-if-possible" = true;
|
||||||
"focus-exclude" = "id = 0x2400001";
|
"focus-exclude" = "name = 'slock'";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue