From f63cde9354504ee9cfecc07517c03736d0f90c26 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Fri, 30 Jan 2026 11:18:38 +0100 Subject: [PATCH 1/6] bump version to 6.8 --- config.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.mk b/config.mk index 6e875f1..982dc21 100644 --- a/config.mk +++ b/config.mk @@ -1,5 +1,5 @@ # dwm version -VERSION = 6.7 +VERSION = 6.8 # Customize below to fit your system From 397d618f1cfbed398ef05d0c9d1e5dbcdb8144e7 Mon Sep 17 00:00:00 2001 From: NRK Date: Thu, 12 Feb 2026 22:28:02 +0000 Subject: [PATCH 2/6] fix not updating _NET_ACTIVE_WINDOW currently clients that set the input field of WM_HINTS to true (c->neverfocus) will never be updated as _NET_ACTIVE_WINDOW even when they are focused. according to the ICCCM [0] the input field of WM_HINTS tells the WM to either use or not use XSetInputFocus(), it shouldn't have any relation to _NET_ACTIVE_WINDOW. EWMH spec [1] also does not mention any relationship between the two. this issue was noticed when launching games via steam/proton and noticing that _NET_ACTIVE_WINDOW was always wrong/stale (i.e not updated to the game window). for reference I've looked at bspwm [2] and it also seems to set _NET_ACTIVE_WINDOW regardless of whether the client has WM_HINTS input true or not. [0]: https://x.org/releases/X11R7.6/doc/xorg-docs/specs/ICCCM/icccm.html#input_focus [1]: https://specifications.freedesktop.org/wm/1.5/ar01s03.html#id-1.4.10 [2]: https://github.com/baskerville/bspwm/blob/c5cf7d3943f9a34a5cb2bab36bf473fd77e7d4f6/src/tree.c#L659-L662 --- dwm.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/dwm.c b/dwm.c index 53b393e..fc4232e 100644 --- a/dwm.c +++ b/dwm.c @@ -1470,12 +1470,10 @@ sendevent(Client *c, Atom proto) void setfocus(Client *c) { - if (!c->neverfocus) { + if (!c->neverfocus) XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime); - XChangeProperty(dpy, root, netatom[NetActiveWindow], - XA_WINDOW, 32, PropModeReplace, - (unsigned char *) &(c->win), 1); - } + XChangeProperty(dpy, root, netatom[NetActiveWindow], XA_WINDOW, 32, + PropModeReplace, (unsigned char *)&c->win, 1); sendevent(c, wmatom[WMTakeFocus]); } From 5c9f30300bec2f7eec9ba61d0c11df999e17f860 Mon Sep 17 00:00:00 2001 From: NRK Date: Sun, 15 Feb 2026 22:59:13 +0000 Subject: [PATCH 3/6] getstate: fix access type and remove redundant cast WM_STATE is defined to be format == 32 which xlib returns as `long` and so accessing it as `unsigned char` is incorrect. and also &p is already an `unsigned char **` and so the cast was completely redundant. given the redundant cast, i assume `p` was `long *` at some time but was changed to `unsigned char *` later, but the pointer access (and the cast) wasn't updated. also add a `format == 32` check as safety measure before accessing, just in case. --- dwm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dwm.c b/dwm.c index fc4232e..a5e1ce9 100644 --- a/dwm.c +++ b/dwm.c @@ -897,10 +897,10 @@ getstate(Window w) Atom real; if (XGetWindowProperty(dpy, w, wmatom[WMState], 0L, 2L, False, wmatom[WMState], - &real, &format, &n, &extra, (unsigned char **)&p) != Success) + &real, &format, &n, &extra, &p) != Success) return -1; - if (n != 0) - result = *p; + if (n != 0 && format == 32) + result = *(long *)p; XFree(p); return result; } From c3dd6a829b3f5cb9474bcca787a9c8a86932d75d Mon Sep 17 00:00:00 2001 From: NRK Date: Tue, 17 Feb 2026 07:31:35 +0000 Subject: [PATCH 4/6] more overflow fix in getatomprop() commit 244fa852 (and a9aa0d8) tried to fix overflow by checking the number of items returned. however this is not sufficient since the format may be lower than 32 bits. to reproduce the crash, i used the reproducer given in commit 244fa85 but changed the XChangeProperty line to the following to set the property to a 1 element 16 bit item: short si = 1; XChangeProperty(d, w, net_wm_state, XA_ATOM, 16, PropModeReplace, (unsigned char *)&si, 1); this client reliably crashes dwm under ASAN since dwm is trying to read a 32 bit value from a 16 bit one. fix it by checking for format == 32 as well. also change the access type from Atom to long, on my machine Atom is typedef-ed to long already but that may not be true everywere. the XGetWindowProperty manpage says format == 32 is returned as `long` so use `long` directly. (N.B: it also might be worth checking if the returned type is XA_ATOM as well, but i wasn't able to cause any crashes by setting different types so i'm leaving it out for now.) --- dwm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dwm.c b/dwm.c index a5e1ce9..0a67103 100644 --- a/dwm.c +++ b/dwm.c @@ -863,15 +863,15 @@ focusstack(const Arg *arg) Atom getatomprop(Client *c, Atom prop) { - int di; + int format; unsigned long nitems, dl; unsigned char *p = NULL; Atom da, atom = None; if (XGetWindowProperty(dpy, c->win, prop, 0L, sizeof atom, False, XA_ATOM, - &da, &di, &nitems, &dl, &p) == Success && p) { - if (nitems > 0) - atom = *(Atom *)p; + &da, &format, &nitems, &dl, &p) == Success && p) { + if (nitems > 0 && format == 32) + atom = *(long *)p; XFree(p); } return atom; From 2bb919e6342ae04242e3af6d5921e550d3e0a619 Mon Sep 17 00:00:00 2001 From: Ruben Gonzalez Date: Sun, 8 Mar 2026 11:24:40 +0200 Subject: [PATCH 5/6] sendmon: resize fullscreen windows to target monitor When a fullscreen window is moved to another monitor (e.g. via tagmon), its geometry does not always match the new monitor's dimensions. Steps to reproduce: 1. Start dwm with two monitors (A and B). 2. Open a window on Monitor A. 3. Make the window fullscreen (e.g. Firefox with F11). 4. Move the window to Monitor B using the tagmon shortcut (Mod+Shift+>). 5. Go to the other monitor (B), observe that the window is still visible on Monitor A and its contents, even though the window's title is seen on Monitor B bar. 6. Go to the monitor A where the window is still in fullscreen, remove the fullscreen and the window automatically will go to monitor B. This fix ensures that fullscreen windows are correctly resized to the new monitor's geometry during the move. --- dwm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dwm.c b/dwm.c index 0a67103..6fe226f 100644 --- a/dwm.c +++ b/dwm.c @@ -1429,6 +1429,8 @@ sendmon(Client *c, Monitor *m) c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ attach(c); attachstack(c); + if (c->isfullscreen) + resizeclient(c, m->mx, m->my, m->mw, m->mh); focus(NULL); arrange(NULL); } From 44dbc6809d05b8f2addc483f882e670db0b6b8e9 Mon Sep 17 00:00:00 2001 From: Ruben Gonzalez Date: Fri, 13 Mar 2026 15:23:24 +0200 Subject: [PATCH 6/6] buttonpress: fix status text click area mismatch The status bar in drawbar() calculates the text width as TEXTW(stext) - lrpad + 2. However, the click detection in buttonpress() used TEXTW(stext) without adjusting for that padding. This created an "extra" clickable area of some pixels to the left of the status text that would incorrectly trigger ClkStatusText actions instead of ClkWinTitle. Steps to reproduce: 1. Set a status text: xsetroot -name "HELLO" 2. Move the mouse to the empty space with some pixels close to the left of the word "HELLO" but in the title area. 3. Middle-click (or any binding for ClkStatusText). 4. You can see that the status bar action is triggered (default a terminal spawns), even though you clicked in the window title area. This fix ensures that the clickable area matches the visual text. --- dwm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dwm.c b/dwm.c index 6fe226f..ab3a84c 100644 --- a/dwm.c +++ b/dwm.c @@ -440,7 +440,7 @@ buttonpress(XEvent *e) arg.ui = 1 << i; } else if (ev->x < x + TEXTW(selmon->ltsymbol)) click = ClkLtSymbol; - else if (ev->x > selmon->ww - (int)TEXTW(stext)) + else if (ev->x > selmon->ww - (int)TEXTW(stext) + lrpad - 2) click = ClkStatusText; else click = ClkWinTitle;