aboutsummaryrefslogtreecommitdiffstats
path: root/dwm-stickyfullscreen-6.8.diff
blob: 01207ba44cfcd5fb937928018d7adfc35ce77af3 (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
From e7782eaa0f7376cf607fe8efa958cd7d1bcf9a75 Mon Sep 17 00:00:00 2001
From: Daniel Guihot <daniel@guihot.net>
Date: Wed, 16 Sep 2026 05:07:55 +1000
Subject: [PATCH] stickyfullscreen: keep fullscreen until the user drops it

Many games clear _NET_WM_STATE_FULLSCREEN themselves when they lose
focus, so switching tags or moving the pointer leaves the window tiled
or windowed. Ignore a clear that arrives while the client is not the
selected client, and restore the geometry when it is focused again. A
clear from the focused client is still honoured, which is how the user
exits fullscreen.
---
 dwm.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/dwm.c b/dwm.c
index 53b393e..82f3a0c 100644
--- a/dwm.c
+++ b/dwm.c
@@ -802,6 +802,8 @@ focus(Client *c)
 		grabbuttons(c, 1);
 		XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColBorder].pixel);
 		setfocus(c);
+		if (lockfullscreen && c->isfullscreen)
+			resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh);
 	} else {
 		XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
 		XDeleteProperty(dpy, root, netatom[NetActiveWindow]);
@@ -1482,6 +1484,8 @@ setfocus(Client *c)
 void
 setfullscreen(Client *c, int fullscreen)
 {
+	if (lockfullscreen && !fullscreen && c->isfullscreen && c != selmon->sel)
+		return;
 	if (fullscreen && !c->isfullscreen) {
 		XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32,
 			PropModeReplace, (unsigned char*)&netatom[NetWMFullscreen], 1);
-- 
2.55.0