aboutsummaryrefslogtreecommitdiff
path: root/src/layout/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/layout/mod.rs')
-rw-r--r--src/layout/mod.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/layout/mod.rs b/src/layout/mod.rs
index 26521f3e..2ed08ba8 100644
--- a/src/layout/mod.rs
+++ b/src/layout/mod.rs
@@ -81,6 +81,9 @@ pub const RESIZE_ANIMATION_THRESHOLD: f64 = 10.;
/// Pointer needs to move this far to pull a window from the layout.
const INTERACTIVE_MOVE_START_THRESHOLD: f64 = 256. * 256.;
+/// Size-relative units.
+pub struct SizeFrac;
+
niri_render_elements! {
LayoutElementRenderElement<R> => {
Wayland = WaylandSurfaceRenderElement<R>,
@@ -3482,14 +3485,17 @@ impl<W: LayoutElement> Layout<W> {
InsertPosition::Floating => {
let pos = move_.tile_render_location() - offset;
+ let mut tile = move_.tile;
+ let pos = mon.workspaces[ws_idx].floating_logical_to_size_frac(pos);
+ tile.set_floating_pos(pos);
+
// Set the floating size so it takes into account any window resizing that
// took place during the move.
- let mut tile = move_.tile;
if let Some(size) = tile.window().expected_size() {
tile.set_floating_window_size(size);
}
- mon.add_floating_tile(ws_idx, tile, Some(pos), true);
+ mon.add_floating_tile(ws_idx, tile, true);
}
}