aboutsummaryrefslogtreecommitdiff
path: root/patches/dwm-netactivewindow-switch-20260904-d84cff9.diff
blob: 9eed1dbc37dcdeff5fe3fa2b8d9b9b07368e9d64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
diff --git a/dwm.c b/dwm.c
index 534a4ea..3c3fc80 100644
--- a/dwm.c
+++ b/dwm.c
@@ -542,8 +542,12 @@ clientmessage(XEvent *e)
 			setfullscreen(c, (cme->data.l[0] == 1 /* _NET_WM_STATE_ADD    */
 				|| (cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */ && !c->isfullscreen)));
 	} else if (cme->message_type == netatom[NetActiveWindow]) {
-		if (c != selmon->sel && !c->isurgent)
-			seturgent(c, 1);
+		if (!ISVISIBLE(c)) {
+			c->mon->tagset[c->mon->seltags] = c->tags;
+			selmon = c->mon;
+			arrange(selmon);
+		}
+		focus(c);
 	}
 }