blob: 3c85f3df901c41144768abe02a42e0fafd1d59a1 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
From 2d620e25e309d539136379e94e65f89c573ba01c Mon Sep 17 00:00:00 2001
From: Daniel Guihot <daniel@guihot.net>
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
|