mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-21 02:01:55 +07:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user