fix(wm): avoid slurping on stack -> stack ops

This commit ensures that when both the origin and target containers are
stacks during a stack operation, the "slurping" stack extension
behaviour introduced in cfb0c7f2ce will
not be applied.

fix #1085
This commit is contained in:
LGUG2Z
2024-10-31 16:58:44 -07:00
parent 7f7b8c7c05
commit ed5b0f9120

View File

@@ -2020,8 +2020,16 @@ impl WindowManager {
new_idx
};
let mut target_container_is_stack = false;
if let Some(container) = workspace.containers().get(adjusted_new_index) {
if container.windows().len() > 1 {
target_container_is_stack = true;
}
}
if let Some(current) = workspace.focused_container() {
if current.windows().len() > 1 {
if current.windows().len() > 1 && !target_container_is_stack {
workspace.focus_container(adjusted_new_index);
workspace.move_window_to_container(current_container_idx)?;
} else {