summaryrefslogtreecommitdiffhomepage
path: root/dwm.c
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2020-11-22 12:52:02 +0100
committerbakkeby <[email protected]>2020-11-22 12:52:02 +0100
commite350e4d93d404fe5be9aca5dbbbd50b0c3ad4860 (patch)
treef8516ab6a05081dfba3660a6da9f5fe21c16ba64 /dwm.c
parent7db8bb0ce93bfc3a6109b047764266f1865ec934 (diff)
downloaddwm-flexipatch-e350e4d93d404fe5be9aca5dbbbd50b0c3ad4860.tar.gz
dwm-flexipatch-e350e4d93d404fe5be9aca5dbbbd50b0c3ad4860.zip
NetActiveWindow: make sure to unfocus previously selected window if moving to another monitor
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/dwm.c b/dwm.c
index cf90f8b..d90b811 100644
--- a/dwm.c
+++ b/dwm.c
@@ -1214,12 +1214,13 @@ clientmessage(XEvent *e)
}
} else if (cme->message_type == netatom[NetActiveWindow]) {
#if FOCUSONNETACTIVE_PATCH
- if (c->tags & c->mon->tagset[c->mon->seltags]) {
- selmon = c->mon;
+ if (c->tags & c->mon->tagset[c->mon->seltags])
focus(c);
- } else {
+ else {
for (i = 0; i < NUMTAGS && !((1 << i) & c->tags); i++);
if (i < NUMTAGS) {
+ if (c != selmon->sel)
+ unfocus(selmon->sel, 0, NULL);
selmon = c->mon;
if (((1 << i) & TAGMASK) != selmon->tagset[selmon->seltags])
view(&((Arg) { .ui = 1 << i }));