From 15bff401c4f038d9c5dde5bdcd142f8b3f22a752 Mon Sep 17 00:00:00 2001 From: Guido Cella Date: Thu, 5 Nov 2026 20:21:05 +0100 Subject: [PATCH] refocus after unsetting fullscreen in mapnotify() Since a6e2c15 focustop() prefers fullscreen clients, so the focusclient(focustop(selmon)) in setmon() focuses the fullscreen client before mapnotify() unsets its fullscreen state, and focus never moves to the new client. --- dwl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dwl.c b/dwl.c index 6ce12a4..6f971c6 100644 --- a/dwl.c +++ b/dwl.c @@ -2019,8 +2019,11 @@ mapnotify(struct wl_listener *listener, void *data) unset_fullscreen: m = c->mon ? c->mon : xytomon(c->geom.x, c->geom.y); wl_list_for_each(w, &clients, link) { - if (w != c && w != p && w->isfullscreen && m == w->mon && (w->tags & c->tags)) + if (w != c && w != p && w->isfullscreen && m == w->mon && (w->tags & c->tags)) { setfullscreen(w, 0); + /* setmon() focused w because focustop() prefers fullscreen clients */ + focusclient(focustop(selmon), NULL, 1); + } } }