mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-21 02:01:55 +07:00
layout: Synchronize unfullscreen view movement anim to resize
Before this commit, maximize/fullscreen was synchronized, but unmaximize/unfullscreen wasn't.
This commit is contained in:
@@ -1386,11 +1386,6 @@ impl<W: LayoutElement> ScrollingSpace<W> {
|
||||
// We might need to move the view to ensure the resized window is still visible. But
|
||||
// only do it when the view isn't frozen by an interactive resize or a view gesture.
|
||||
if self.interactive_resize.is_none() && !self.view_offset.is_gesture() {
|
||||
// Restore the view offset upon unfullscreening if needed.
|
||||
if let Some(prev_offset) = unfullscreen_offset {
|
||||
self.animate_view_offset(col_idx, prev_offset);
|
||||
}
|
||||
|
||||
// Synchronize the horizontal view movement with the resize so that it looks nice.
|
||||
// This is especially important for always-centered view.
|
||||
let config = if ongoing_resize_anim {
|
||||
@@ -1399,6 +1394,11 @@ impl<W: LayoutElement> ScrollingSpace<W> {
|
||||
self.options.animations.horizontal_view_movement.0
|
||||
};
|
||||
|
||||
// Restore the view offset upon unfullscreening if needed.
|
||||
if let Some(prev_offset) = unfullscreen_offset {
|
||||
self.animate_view_offset_with_config(col_idx, prev_offset, config);
|
||||
}
|
||||
|
||||
// FIXME: we will want to skip the animation in some cases here to make continuously
|
||||
// resizing windows not look janky.
|
||||
self.animate_view_offset_to_column_with_config(None, col_idx, None, config);
|
||||
|
||||
Reference in New Issue
Block a user