aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Guihot2026-09-16 06:18:28 +1000
committerDaniel Guihot2026-09-16 06:18:28 +1000
commit9fb46ad2fffcbf77f8c0f98c3c6ce3a043f09892 (patch)
treed90da4bd16fad110d6daa82ead86eb12c1852093
downloaddwm-deiconify-9fb46ad2fffcbf77f8c0f98c3c6ce3a043f09892.tar.gz
dwm-deiconify-9fb46ad2fffcbf77f8c0f98c3c6ce3a043f09892.zip
Add dwm 6.8 deiconify patchHEADmain
Restore WM_STATE to NormalState when a fullscreen client receives focus.
-rw-r--r--README.md29
-rw-r--r--dwm-deiconify-6.8.diff29
2 files changed, 58 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..4beea98
--- /dev/null
+++ b/README.md
@@ -0,0 +1,29 @@
+# deiconify
+
+## Description
+
+This patch restores `WM_STATE` to `NormalState` when a fullscreen client
+receives focus. It applies to dwm 6.8.
+
+Some Steam/Proton games and native games set `WM_STATE` to `IconicState` when
+they lose focus. dwm can map and focus the window again while the client still
+considers itself minimized, leaving a black window. The patch adds two lines
+to `setfocus()` so a returning fullscreen client resumes drawing.
+
+Only fullscreen clients are changed. Normal clients keep their existing
+`WM_STATE` behaviour. No configuration is added.
+
+## Testing
+
+Applies and builds against dwm 6.8. Runtime tested under Xvfb by forcing a
+fullscreen client to `IconicState`, switching tags, and checking that it
+returned as `NormalState`. The test also covered fullscreen clients with the
+`InputHint` set to false and confirmed that normal clients were unchanged.
+
+## Download
+
+* [dwm-deiconify-6.8.diff](dwm-deiconify-6.8.diff)
+
+## Author
+
+* Daniel Guihot - [daniel@guihot.net](mailto:daniel@guihot.net)
diff --git a/dwm-deiconify-6.8.diff b/dwm-deiconify-6.8.diff
new file mode 100644
index 0000000..04aed35
--- /dev/null
+++ b/dwm-deiconify-6.8.diff
@@ -0,0 +1,29 @@
+From 456668b4d64e0b3cd79b6d7ffa835a006d9c5941 Mon Sep 17 00:00:00 2001
+From: Daniel Guihot <daniel@guihot.net>
+Date: Wed, 16 Sep 2026 05:46:17 +1000
+Subject: [PATCH] deiconify: restore focused fullscreen clients
+
+Some games leave WM_STATE set to IconicState after losing focus. dwm
+can map and focus the window again while the client still considers
+itself minimized, leaving a black window. Set NormalState when a
+fullscreen client receives focus so it resumes drawing.
+---
+ dwm.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/dwm.c b/dwm.c
+index 53b393e..505c1f3 100644
+--- a/dwm.c
++++ b/dwm.c
+@@ -1476,6 +1476,8 @@ setfocus(Client *c)
+ XA_WINDOW, 32, PropModeReplace,
+ (unsigned char *) &(c->win), 1);
+ }
++ if (c->isfullscreen)
++ setclientstate(c, NormalState);
+ sendevent(c, wmatom[WMTakeFocus]);
+ }
+
+--
+2.55.0
+