Skip to content

Commit

Permalink
fix(wm): avoid slurping on stack -> stack ops
Browse files Browse the repository at this point in the history
This commit ensures that when both the origin and target containers are
stacks during a stack operation, the "slurping" stack extension
behaviour introduced in cfb0c7f will
not be applied.

fix #1085
  • Loading branch information
LGUG2Z committed Oct 31, 2024
1 parent 7f7b8c7 commit ed5b0f9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion komorebi/src/window_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit ed5b0f9

Please sign in to comment.