From 9b52465e429f64fcdab091d428ff3a01def35ca1 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Sat, 20 Dec 2025 09:08:10 +0300 Subject: [PATCH] layout: Synchronize unfullscreen view movement anim to resize Before this commit, maximize/fullscreen was synchronized, but unmaximize/unfullscreen wasn't. --- src/layout/scrolling.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/layout/scrolling.rs b/src/layout/scrolling.rs index d9a0dc2e..eaeb7751 100644 --- a/src/layout/scrolling.rs +++ b/src/layout/scrolling.rs @@ -1386,11 +1386,6 @@ impl ScrollingSpace { // 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 ScrollingSpace { 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);