diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-04-19 12:44:24 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-04-19 12:44:24 +0400 |
| commit | 2c8d1030ab2ea8cf65f2000056060d70c8627edc (patch) | |
| tree | 461a1d1f8a07e206d4788bd2a22dd76880737961 /src/layout/workspace.rs | |
| parent | f51dd67f2d4beaeb0bad697ec026685a8efc5ca8 (diff) | |
| download | niri-2c8d1030ab2ea8cf65f2000056060d70c8627edc.tar.gz niri-2c8d1030ab2ea8cf65f2000056060d70c8627edc.tar.bz2 niri-2c8d1030ab2ea8cf65f2000056060d70c8627edc.zip | |
Separate tile X and Y movement animations
Helps with the jank caused by lack of transactions when consuming to the
left/right. Resize triggers a few frames later and restarts the
movement. Now it only restarts the vertical and not the horizontal
movement.
Diffstat (limited to 'src/layout/workspace.rs')
| -rw-r--r-- | src/layout/workspace.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/layout/workspace.rs b/src/layout/workspace.rs index 6f280720..71af8f40 100644 --- a/src/layout/workspace.rs +++ b/src/layout/workspace.rs @@ -920,7 +920,7 @@ impl<W: LayoutElement> Workspace<W> { // Animate movement of other tiles. let offset_y = column.tile_y(window_idx + 1) - column.tile_y(window_idx); for tile in &mut column.tiles[window_idx + 1..] { - tile.animate_move_from(Point::from((0, offset_y))); + tile.animate_move_y_from(offset_y); } let tile = column.tiles.remove(window_idx); @@ -2323,8 +2323,8 @@ impl<W: LayoutElement> Column<W> { // Move windows below in tandem with resizing. if tile.resize_animation().is_some() && offset != 0 { for tile in &mut self.tiles[tile_idx + 1..] { - tile.animate_move_from_with_config( - Point::from((0, offset)), + tile.animate_move_y_from_with_config( + offset, self.options.animations.window_resize.0, ); } @@ -2525,8 +2525,8 @@ impl<W: LayoutElement> Column<W> { // Animate the movement. let new_active_y = self.tile_y(new_idx); - self.tiles[new_idx].animate_move_from(Point::from((0, active_y - new_active_y))); - self.tiles[new_idx + 1].animate_move_from(Point::from((0, active_y - next_y))); + self.tiles[new_idx].animate_move_y_from(active_y - new_active_y); + self.tiles[new_idx + 1].animate_move_y_from(active_y - next_y); } fn move_down(&mut self) { @@ -2546,8 +2546,8 @@ impl<W: LayoutElement> Column<W> { // Animate the movement. let new_active_y = self.tile_y(new_idx); - self.tiles[new_idx].animate_move_from(Point::from((0, active_y - new_active_y))); - self.tiles[new_idx - 1].animate_move_from(Point::from((0, next_y - active_y))); + self.tiles[new_idx].animate_move_y_from(active_y - new_active_y); + self.tiles[new_idx - 1].animate_move_y_from(next_y - active_y); } #[cfg(test)] |
