From 2a9d0e495a011a124b37532dfcfb3c780fd2eb89 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Thu, 25 Dec 2025 14:11:31 +0300 Subject: [PATCH] Fix consume-or-expel-left anim to the left of active column Regressed in c4462d0c7fddfc11c9e98d43e3ef68a5b3c844ca. --- src/layout/scrolling.rs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/layout/scrolling.rs b/src/layout/scrolling.rs index 5d36495f..8075739b 100644 --- a/src/layout/scrolling.rs +++ b/src/layout/scrolling.rs @@ -990,6 +990,19 @@ impl ScrollingSpace { self.active_column_idx += 1; } + // Animate movement of other columns. + let offset = self.column_x(idx + 1) - self.column_x(idx); + let config = anim_config.unwrap_or(self.options.animations.window_movement.0); + if self.active_column_idx <= idx { + for col in &mut self.columns[idx + 1..] { + col.animate_move_from_with_config(-offset, config); + } + } else { + for col in &mut self.columns[..idx] { + col.animate_move_from_with_config(offset, config); + } + } + if activate { // If this is the first window on an empty workspace, remove the effect of whatever // view_offset was left over and skip the animation. @@ -1007,19 +1020,6 @@ impl ScrollingSpace { self.activate_column_with_anim_config(idx, anim_config); self.activate_prev_column_on_removal = prev_offset; } - - // Animate movement of other columns. - let offset = self.column_x(idx + 1) - self.column_x(idx); - let config = anim_config.unwrap_or(self.options.animations.window_movement.0); - if self.active_column_idx <= idx { - for col in &mut self.columns[idx + 1..] { - col.animate_move_from_with_config(-offset, config); - } - } else { - for col in &mut self.columns[..idx] { - col.animate_move_from_with_config(offset, config); - } - } } pub fn remove_active_tile(&mut self, transaction: Transaction) -> Option> { @@ -1858,7 +1858,7 @@ impl ScrollingSpace { self.activate_prev_column_on_removal = None; } - if target_column_idx < self.active_column_idx { + if target_column_idx <= self.active_column_idx { // Tiles to the left animate from the following column. offset.x += self.column_x(target_column_idx + 1) - self.column_x(target_column_idx); }