aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2025-09-03 16:02:04 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2025-09-17 22:04:23 +0300
commita3203d92ecbdf6ffa6452be6c95324215b9360b0 (patch)
treee604256c98c269aa4db0b0041668e4ea68c001a7 /src
parentc832bdecdda44648542f60dab73904f3e80dc857 (diff)
downloadniri-a3203d92ecbdf6ffa6452be6c95324215b9360b0.tar.gz
niri-a3203d92ecbdf6ffa6452be6c95324215b9360b0.tar.bz2
niri-a3203d92ecbdf6ffa6452be6c95324215b9360b0.zip
layout/scrolling: Animate tiles_origin changing on un/fullscreen
Diffstat (limited to 'src')
-rw-r--r--src/layout/scrolling.rs13
1 files changed, 13 insertions, 0 deletions
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<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