diff options
| author | NRK <nrk@disroot.org> | 2026-02-12 22:28:02 +0000 |
|---|---|---|
| committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2026-02-13 10:16:08 +0100 |
| commit | 397d618f1cfbed398ef05d0c9d1e5dbcdb8144e7 (patch) | |
| tree | 07561f349d16318db137e000e41c1e078c04cf3c | |
| parent | bump version to 6.8 (diff) | |
| download | dwm-397d618f1cfbed398ef05d0c9d1e5dbcdb8144e7.tar.gz dwm-397d618f1cfbed398ef05d0c9d1e5dbcdb8144e7.zip | |
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
| -rw-r--r-- | dwm.c | 8 |
1 files changed, 3 insertions, 5 deletions
| @@ -1470,12 +1470,10 @@ sendevent(Client *c, Atom proto) | |||
| 1470 | void | 1470 | void |
| 1471 | setfocus(Client *c) | 1471 | setfocus(Client *c) |
| 1472 | { | 1472 | { |
| 1473 | if (!c->neverfocus) { | 1473 | if (!c->neverfocus) |
| 1474 | XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime); | 1474 | XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime); |
| 1475 | XChangeProperty(dpy, root, netatom[NetActiveWindow], | 1475 | XChangeProperty(dpy, root, netatom[NetActiveWindow], XA_WINDOW, 32, |
| 1476 | XA_WINDOW, 32, PropModeReplace, | 1476 | PropModeReplace, (unsigned char *)&c->win, 1); |
| 1477 | (unsigned char *) &(c->win), 1); | ||
| 1478 | } | ||
| 1479 | sendevent(c, wmatom[WMTakeFocus]); | 1477 | sendevent(c, wmatom[WMTakeFocus]); |
| 1480 | } | 1478 | } |
| 1481 | 1479 | ||
