From 60138353379f59a3724416d52560778fff60db58 Mon Sep 17 00:00:00 2001 From: Guido Cella Date: Tue, 15 Sep 2026 22:17:24 +0200 Subject: [PATCH] keep the focused border color of the old client in certain cases When focusing an unmanaged client (like dmenu) or a layer shell surface (like wmenu) keep the focused border color of the regular client, but still deactivate it. This is consistent with dwm and sway. This was already done for unmanaged clients but not for layer shell surfaces. This is not perfect because you can press MODKEY+j/k or move the cursor while a program like dmenu is focused and have 2 clients with focused border color after closing dmenu. But this doesn't work well even in sway where if you change focus while dmenu is open you can longer focus it, and after closing a layer shell surface with on-demand keyboard interactivity all toplevels have the focused border color, so this will do for now. --- dwl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dwl.c b/dwl.c index 190235d..63996a2 100644 --- a/dwl.c +++ b/dwl.c @@ -1540,7 +1540,8 @@ focusclient(Client *c, int lift) } else if (old_c && old_c == exclusive_focus && client_wants_focus(old_c)) { return; } else if (old_c && !client_is_unmanaged(old_c)) { - client_set_border_color(old_c, bordercolor); + if (c && !client_is_unmanaged(c)) + client_set_border_color(old_c, bordercolor); client_activate_surface(old, 0); }