layout: Stop workspace switch when moving workspaces to primary

Okay, this might be one of the oldest layout issues to have remained uncaught.
Well, maybe as I add more randomized tests, I'll catch even more of those.
This commit is contained in:
Ivan Molodetskikh
2024-11-27 20:49:07 +03:00
parent 4c480a1ea3
commit 815fa379ea
+12
View File
@@ -634,6 +634,14 @@ impl<W: LayoutElement> Layout<W> {
ws.set_output(Some(primary.output.clone()));
}
let mut stopped_primary_ws_switch = false;
if !workspaces.is_empty() && primary.workspace_switch.is_some() {
// FIXME: if we're adding workspaces to currently invisible positions
// (outside the workspace switch), we don't need to cancel it.
primary.workspace_switch = None;
stopped_primary_ws_switch = true;
}
let empty_was_focused =
primary.active_workspace_idx == primary.workspaces.len() - 1;
@@ -648,6 +656,10 @@ impl<W: LayoutElement> Layout<W> {
primary.active_workspace_idx = primary.workspaces.len() - 1;
}
if stopped_primary_ws_switch {
primary.clean_up_workspaces();
}
MonitorSet::Normal {
monitors,
primary_idx,