From eff172a236cf84a0495ddc17384db1e341cd9fb6 Mon Sep 17 00:00:00 2001 From: Abhinav Prasai Date: Mon, 25 Aug 2025 00:04:49 +0100 Subject: 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 --- src/sxwm.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') 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; } } -- cgit v1.2.3