forge
Explore
Log in

Don't you dare go Hollow

layout: Stop workspace switch when moving workspaces to primary

Browse files at this commit

815fa379ea1ba2ed9c9efff94e0b48374185f5deIvan MolodetskikhParent: 4c480a1
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.
src/layout/mod.rsmodified+12 -0
@@ -634,6 +634,14 @@ impl<W: LayoutElement> Layout<W> {
634 ws.set_output(Some(primary.output.clone()));634 ws.set_output(Some(primary.output.clone()));
635 }635 }
636 636
637+ let mut stopped_primary_ws_switch = false;
638+ if !workspaces.is_empty() && primary.workspace_switch.is_some() {
639+ // FIXME: if we're adding workspaces to currently invisible positions
640+ // (outside the workspace switch), we don't need to cancel it.
641+ primary.workspace_switch = None;
642+ stopped_primary_ws_switch = true;
643+ }
644+
637 let empty_was_focused =645 let empty_was_focused =
638 primary.active_workspace_idx == primary.workspaces.len() - 1;646 primary.active_workspace_idx == primary.workspaces.len() - 1;
639 647
@@ -648,6 +656,10 @@ impl<W: LayoutElement> Layout<W> {
648 primary.active_workspace_idx = primary.workspaces.len() - 1;656 primary.active_workspace_idx = primary.workspaces.len() - 1;
649 }657 }
650 658
659+ if stopped_primary_ws_switch {
660+ primary.clean_up_workspaces();
661+ }
662+
651 MonitorSet::Normal {663 MonitorSet::Normal {
652 monitors,664 monitors,
653 primary_idx,665 primary_idx,