diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2025-09-04 08:16:47 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2025-09-17 22:04:23 +0300 |
| commit | a0d002c318b79b09a9ba4b4cbeea772fa3b7de33 (patch) | |
| tree | 1a5e6dbccf2a821aaa7c32fd2649ca211f3d99d5 /src/layout/scrolling.rs | |
| parent | d0e98d6e7314c1b0e5aa9257b99443e640f113d8 (diff) | |
| download | niri-a0d002c318b79b09a9ba4b4cbeea772fa3b7de33.tar.gz niri-a0d002c318b79b09a9ba4b4cbeea772fa3b7de33.tar.bz2 niri-a0d002c318b79b09a9ba4b4cbeea772fa3b7de33.zip | |
layout/tile: Animate un/fullscreen resize
This turned out to require quite a few changes.
We keep track of the tile resize animation progress separately now, in order to
provide a resizing black fullscreen backdrop for non-resizable windows.
The window is always rendered in the middle of the tile, which once again aids
with the resizing black fullscreen backdrop.
The backdrop itself will fade in from transparency so that it's less jarring.
The resize animation now keeps track of the fullscreen progress to deal with
the case where an unfullscreen resize is interrupted by another non-fullscreen
resize. In this case, the fullscreen progress continues animating to avoid
sudden disappearance of the fullscreen backdrop.
Some things like border visibility switch to this fullscreen progress once again
to avoid jarring appearance/disappearance.
The border radius animates in accordance with the fullscreen progress to match
the visuals.
Diffstat (limited to 'src/layout/scrolling.rs')
| -rw-r--r-- | src/layout/scrolling.rs | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/src/layout/scrolling.rs b/src/layout/scrolling.rs index 04788bca..78a072ff 100644 --- a/src/layout/scrolling.rs +++ b/src/layout/scrolling.rs @@ -2778,11 +2778,10 @@ impl<W: LayoutElement> ScrollingSpace<W> { } pub fn set_fullscreen(&mut self, window: &W::Id, is_fullscreen: bool) -> bool { - let (mut col_idx, tile_idx) = self + let mut col_idx = self .columns .iter() - .enumerate() - .find_map(|(col_idx, col)| col.position(window).map(|tile_idx| (col_idx, tile_idx))) + .position(|col| col.contains(window)) .unwrap(); if is_fullscreen == self.columns[col_idx].is_pending_fullscreen { @@ -2796,21 +2795,7 @@ impl<W: LayoutElement> ScrollingSpace<W> { if is_fullscreen && (col.tiles.len() > 1 && !is_tabbed) { // This wasn't the only window in its column; extract it into a separate column. - let activate = self.active_column_idx == col_idx && col.active_tile_idx == tile_idx; - - let removed = self.remove_tile_by_idx(col_idx, tile_idx, Transaction::new(), None); - // Create a column manually to disable the resize animation. - let column = Column::new_with_tile( - removed.tile, - self.view_size, - self.working_area, - self.scale, - removed.width, - removed.is_full_width, - false, - ); - self.add_column(Some(col_idx + 1), column, activate, None); - + self.consume_or_expel_window_right(Some(window)); col_idx += 1; col = &mut self.columns[col_idx]; } @@ -4881,7 +4866,7 @@ impl<W: LayoutElement> Column<W> { } self.is_pending_fullscreen = is_fullscreen; - self.update_tile_sizes(false); + self.update_tile_sizes(true); } fn set_column_display(&mut self, display: ColumnDisplay) { |
