From 2d620e25e309d539136379e94e65f89c573ba01c Mon Sep 17 00:00:00 2001 From: Daniel Guihot Date: Wed, 16 Sep 2026 05:06:53 +1000 Subject: [PATCH] focusguard: keep focus on visible fullscreen clients When focus would move to a normal client, keep it on a visible fullscreen client on the same monitor while lockfullscreen is set. This covers newly managed windows and other focus paths. Raise the fullscreen client after focusing it so the blocked window cannot obscure it. --- dwm.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dwm.c b/dwm.c index 53b393e..15913cc 100644 --- a/dwm.c +++ b/dwm.c @@ -788,8 +788,19 @@ expose(XEvent *e) void focus(Client *c) { + Client *f; + if (!c || !ISVISIBLE(c)) for (c = selmon->stack; c && !ISVISIBLE(c); c = c->snext); + if (lockfullscreen && c && !c->isfullscreen) { + for (f = c->mon->stack; f; f = f->snext) { + if (ISVISIBLE(f) && f->isfullscreen) { + c = f; + XRaiseWindow(dpy, c->win); + break; + } + } + } if (selmon->sel && selmon->sel != c) unfocus(selmon->sel, 0); if (c) { -- 2.55.0