aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Guihot2026-09-16 05:23:04 +1000
committerDaniel Guihot2026-09-16 05:23:04 +1000
commitd4c18b7169c56e69330411b21284dfce1aae5765 (patch)
tree56f085a11b33e35f09e19d63a03d113d47f72418
downloaddwm-stickyfullscreen-d4c18b7169c56e69330411b21284dfce1aae5765.tar.gz
dwm-stickyfullscreen-d4c18b7169c56e69330411b21284dfce1aae5765.zip
dwm 6.8 stickyfullscreen patch
-rw-r--r--README.md32
-rw-r--r--dwm-stickyfullscreen-6.8.diff40
2 files changed, 72 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..839f142
--- /dev/null
+++ b/README.md
@@ -0,0 +1,32 @@
+# stickyfullscreen
+
+## Description
+
+This patch keeps a client fullscreen until the user drops it. It applies to
+dwm 6.8.
+
+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.
+With this patch a clear that arrives while the client is not the selected
+client is ignored, and `focus()` restores the fullscreen geometry when the
+client is focused again. A clear from the focused client is still honoured, so
+the game's own exit or Alt+Enter works as before.
+
+## Configuration
+
+The patch uses the existing `lockfullscreen` option in `config.h`. Set it to
+0 to disable the behaviour. No new options are added.
+
+## Testing
+
+Applies and builds against dwm 6.8. Runtime tested under Xvfb: a fullscreen
+clear sent while unfocused is ignored, and the same clear while focused is
+honoured.
+
+## Download
+
+* [dwm-stickyfullscreen-6.8.diff](dwm-stickyfullscreen-6.8.diff)
+
+## Author
+
+* Daniel Guihot - [daniel@guihot.net](mailto:daniel@guihot.net)
diff --git a/dwm-stickyfullscreen-6.8.diff b/dwm-stickyfullscreen-6.8.diff
new file mode 100644
index 0000000..5634b5a
--- /dev/null
+++ b/dwm-stickyfullscreen-6.8.diff
@@ -0,0 +1,40 @@
+From 94ac1398e3665214a5156f4ab6aad48f9fd6e265 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..512a3ec 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 (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
+