From c72002e15acf9327d9c21a192a1b3f04d0528e06 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Mon, 10 Mar 2025 13:33:02 -0700 Subject: [PATCH] shell: If active workspace moved, add `WState::Active` to new active --- src/shell/mod.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/shell/mod.rs b/src/shell/mod.rs index 5ab2737a..d80516d2 100644 --- a/src/shell/mod.rs +++ b/src/shell/mod.rs @@ -705,7 +705,12 @@ impl Workspaces { .workspaces .iter() .position(|w| w.handle == active_handle) - .unwrap_or(other_set.workspaces.len() - 1); + .unwrap_or_else(|| { + let idx = other_set.workspaces.len() - 1; + let workspace = &other_set.workspaces[idx]; + workspace_state.add_workspace_state(&workspace.handle, WState::Active); + idx + }) } // Add `moved_workspaces` to set, and update output and index of workspaces