summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhinav Prasai <abhinav.prsai@gmail.com>2025-08-25 00:04:49 +0100
committerAbhinav Prasai <abhinav.prsai@gmail.com>2025-08-25 00:04:49 +0100
commiteff172a236cf84a0495ddc17384db1e341cd9fb6 (patch)
tree44ac87d8f8904edb8e9342f8c59f285a10b8b978
parent4cae189cc6757cd6efd0f2edbe3b1aa7a95b78c8 (diff)
properly set monitor on workspace switch
before it just used to focus on nothing if there was no window in the other workspace, even if there was one on the other monitor. now it focuses on the first window visible
-rw-r--r--src/sxwm.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/sxwm.c b/src/sxwm.c
index b5f5ca7..cb25702 100644
--- a/src/sxwm.c
+++ b/src/sxwm.c
@@ -382,13 +382,18 @@ void change_workspace(int ws)
}
/* if no scratchpad found focus regular window */
+ Client *cached = NULL;
if (!focused && workspaces[current_ws]) {
for (Client *c = workspaces[current_ws]; c; c = c->next) {
/* TODO TEST */
+ cached = c;
if (c->mon == current_mon) {
focused = c;
+ current_mon = c->mon;
break;
}
+ focused = cached;
+ current_mon = cached->mon;
}
}