mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-21 02:01:55 +07:00
Fix consume-or-expel-left anim to the left of active column
Regressed in c4462d0c7f.
This commit is contained in:
+14
-14
@@ -990,6 +990,19 @@ impl<W: LayoutElement> ScrollingSpace<W> {
|
||||
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<W: LayoutElement> ScrollingSpace<W> {
|
||||
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<RemovedTile<W>> {
|
||||
@@ -1858,7 +1858,7 @@ impl<W: LayoutElement> ScrollingSpace<W> {
|
||||
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user