summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhinav <abhinav.prsai@gmail.com>2025-06-08 23:20:29 +0100
committerAbhinav <abhinav.prsai@gmail.com>2025-06-08 23:20:29 +0100
commit0da7d75c70cbe3f1e03856d4fe7b10642a6d550c (patch)
treeafd2bb2fc4f9ae14b25f05c6c72f98b7272f1b0b
parent9602d0d5678bd46545af20b3cf765c3c0ed9cb45 (diff)
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
-rw-r--r--src/sxwm.c6
1 files changed, 6 insertions, 0 deletions
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;