aboutsummaryrefslogtreecommitdiff
path: root/src/layout/mod.rs
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2024-12-23 08:52:45 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2024-12-30 20:12:37 +0300
commite409453fbd49a30e2059271b78567b430dc5800a (patch)
tree2b08ea86c3146f09207dba3e148bd228ff310a68 /src/layout/mod.rs
parent309bf1348c67a81b99e7b3feef461584ca7cd423 (diff)
downloadniri-e409453fbd49a30e2059271b78567b430dc5800a.tar.gz
niri-e409453fbd49a30e2059271b78567b430dc5800a.tar.bz2
niri-e409453fbd49a30e2059271b78567b430dc5800a.zip
floating: Update stored size only on removal
Diffstat (limited to 'src/layout/mod.rs')
-rw-r--r--src/layout/mod.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/layout/mod.rs b/src/layout/mod.rs
index bc2716af..be5eadc1 100644
--- a/src/layout/mod.rs
+++ b/src/layout/mod.rs
@@ -1164,12 +1164,6 @@ impl<W: LayoutElement> Layout<W> {
if let Some(InteractiveMoveState::Moving(move_)) = &mut self.interactive_move {
if move_.tile.window().id() == window {
move_.tile.update_window();
-
- // Update the floating size in case the window resizes itself during an interactive
- // move.
- let floating_size = move_.tile.window().expected_size();
- move_.tile.set_floating_window_size(floating_size);
-
return;
}
}
@@ -3464,7 +3458,13 @@ impl<W: LayoutElement> Layout<W> {
}
InsertPosition::Floating => {
let pos = move_.tile_render_location() - offset;
- mon.add_floating_tile(ws_idx, move_.tile, Some(pos), true);
+
+ // Set the floating size so it takes into account any window resizing that
+ // took place during the move.
+ let mut tile = move_.tile;
+ tile.set_floating_window_size(tile.window().expected_size());
+
+ mon.add_floating_tile(ws_idx, tile, Some(pos), true);
}
}