mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-23 02:05:33 +07:00
layout/scrolling: Animate tiles_origin changing on un/fullscreen
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user