From 0da7d75c70cbe3f1e03856d4fe7b10642a6d550c Mon Sep 17 00:00:00 2001 From: Abhinav Date: Sun, 8 Jun 2025 23:20:29 +0100 Subject: change focus when switching workspaces before when changing workspaces it would keep the focus on the previous workspace if the changed workspace had no windows. fixed --- src/sxwm.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/sxwm.c b/src/sxwm.c index 6eff793..bd13262 100644 --- a/src/sxwm.c +++ b/src/sxwm.c @@ -248,6 +248,8 @@ void change_workspace(int ws) } tile(); + + focused = NULL; if (workspaces[current_ws]) { focused = workspaces[current_ws]; Window focused_win = find_toplevel(focused->win); @@ -255,6 +257,10 @@ void change_workspace(int ws) if (user_config.warp_cursor) { warp_cursor(focused); } + update_borders(); + } + else { + XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); } long cd = current_ws; -- cgit v1.2.3