diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-12-23 08:52:45 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-12-30 20:12:37 +0300 |
| commit | e409453fbd49a30e2059271b78567b430dc5800a (patch) | |
| tree | 2b08ea86c3146f09207dba3e148bd228ff310a68 /src/layout/floating.rs | |
| parent | 309bf1348c67a81b99e7b3feef461584ca7cd423 (diff) | |
| download | niri-e409453fbd49a30e2059271b78567b430dc5800a.tar.gz niri-e409453fbd49a30e2059271b78567b430dc5800a.tar.bz2 niri-e409453fbd49a30e2059271b78567b430dc5800a.zip | |
floating: Update stored size only on removal
Diffstat (limited to 'src/layout/floating.rs')
| -rw-r--r-- | src/layout/floating.rs | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/layout/floating.rs b/src/layout/floating.rs index 8c1840d4..58ef8427 100644 --- a/src/layout/floating.rs +++ b/src/layout/floating.rs @@ -465,7 +465,7 @@ impl<W: LayoutElement> FloatingSpace<W> { } fn remove_tile_by_idx(&mut self, idx: usize) -> RemovedTile<W> { - let tile = self.tiles.remove(idx); + let mut tile = self.tiles.remove(idx); self.data.remove(idx); if self.tiles.is_empty() { @@ -482,6 +482,9 @@ impl<W: LayoutElement> FloatingSpace<W> { } } + // Store the floating size. + tile.set_floating_window_size(tile.window().expected_size()); + let width = ColumnWidth::Fixed(tile.window_size().w); RemovedTile { tile, @@ -602,9 +605,6 @@ impl<W: LayoutElement> FloatingSpace<W> { let win_size = Size::from((win_width, win_height)); win.request_size_once(win_size, animate); - - // Store it right away so pending resizes are not lost when moving across floating spaces. - tile.set_floating_window_size(win_size); } pub fn set_window_height(&mut self, id: Option<&W::Id>, change: SizeChange, animate: bool) { @@ -631,9 +631,6 @@ impl<W: LayoutElement> FloatingSpace<W> { let win_size = Size::from((win_width, win_height)); win.request_size_once(win_size, animate); - - // Store it right away so pending resizes are not lost when moving across floating spaces. - tile.set_floating_window_size(win_size); } fn focus_directional( @@ -762,10 +759,6 @@ impl<W: LayoutElement> FloatingSpace<W> { tile.update_window(); data.update(tile); - // Update the stored floating window size. - let floating_size = tile.window().expected_size(); - tile.set_floating_window_size(floating_size); - // When resizing by top/left edge, update the position accordingly. if let Some(resize) = resize { let mut offset = Point::from((0., 0.)); |
