From 033814d6ef1cb07606fa77fecb79b8ab66c2ff1d Mon Sep 17 00:00:00 2001 From: mWalrus Date: Tue, 20 May 2025 14:22:19 +0200 Subject: [PATCH] fix: guard `unfocusclient` behind `sloppyfocus` --- dwl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dwl.c b/dwl.c index 5d4e51c..401646f 100644 --- a/dwl.c +++ b/dwl.c @@ -2064,10 +2064,13 @@ pointerfocus(Client *c, struct wlr_surface *surface, double sx, double sy, sloppyfocus && time && c && !client_is_unmanaged(c)) focusclient(c, 0); + /* Unfocus any focused clients if surface is NULL and focus should follow mouse */ + if (!surface && sloppyfocus) + focusclient(NULL, 0); + /* If surface is NULL, clear pointer focus */ if (!surface) { wlr_seat_pointer_notify_clear_focus(seat); - focusclient(NULL, 0); return; }