layout/scrolling: Animate tiles_origin changing on un/fullscreen

This commit is contained in:
Ivan Molodetskikh
2025-09-03 16:02:04 +03:00
parent c832bdecdd
commit a3203d92ec
+13
View File
@@ -1226,6 +1226,7 @@ impl<W: LayoutElement> ScrollingSpace<W> {
.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<W: LayoutElement> ScrollingSpace<W> {
}
}
// 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