From a3203d92ecbdf6ffa6452be6c95324215b9360b0 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Wed, 3 Sep 2025 16:02:04 +0300 Subject: layout/scrolling: Animate tiles_origin changing on un/fullscreen --- src/layout/scrolling.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/layout/scrolling.rs') diff --git a/src/layout/scrolling.rs b/src/layout/scrolling.rs index 48773110..04788bca 100644 --- a/src/layout/scrolling.rs +++ b/src/layout/scrolling.rs @@ -1226,6 +1226,7 @@ impl ScrollingSpace { .find(|(_, col)| col.contains(window)) .unwrap(); let was_fullscreen = column.is_fullscreen(); + let prev_origin = column.tiles_origin(); let (tile_idx, tile) = column .tiles @@ -1295,6 +1296,18 @@ impl ScrollingSpace { } } + // When a column goes between fullscreen and non-fullscreen, the tiles origin can change. + // The change comes from things like ignoring struts and hiding the tab indicator in + // fullscreen, so both in X and Y directions. + let column = &mut self.columns[col_idx]; + let new_origin = column.tiles_origin(); + let origin_delta = prev_origin - new_origin; + if origin_delta != Point::new(0., 0.) { + for (tile, _pos) in column.tiles_mut() { + tile.animate_move_from(origin_delta); + } + } + if col_idx == self.active_column_idx { // If offset == 0, then don't mess with the view or the gesture. Some clients (Firefox, // Chromium, Electron) currently don't commit after the ack of a configure that drops -- cgit