aboutsummaryrefslogtreecommitdiff
path: root/src/layout/tests.rs
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2025-04-30 20:16:45 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2025-04-30 20:32:56 +0300
commit9fb02b9571a7d84c9e6a93b75e5352c411113640 (patch)
tree5f5ce8e3cc9ec6588dc8757aae6d650af3b94c29 /src/layout/tests.rs
parent0e9496b01e04719c68f19b80f3579258ae70b956 (diff)
downloadniri-9fb02b9571a7d84c9e6a93b75e5352c411113640.tar.gz
niri-9fb02b9571a7d84c9e6a93b75e5352c411113640.tar.bz2
niri-9fb02b9571a7d84c9e6a93b75e5352c411113640.zip
layout: Fix DnD scroll not stopping when interactive moving unfullscreen to floating
Diffstat (limited to 'src/layout/tests.rs')
-rw-r--r--src/layout/tests.rs38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/layout/tests.rs b/src/layout/tests.rs
index bd845903..349f95d7 100644
--- a/src/layout/tests.rs
+++ b/src/layout/tests.rs
@@ -3354,6 +3354,44 @@ fn interactive_resize_on_pending_unfullscreen_column() {
check_ops(&ops);
}
+#[test]
+fn interactive_move_unfullscreen_to_floating_stops_dnd_scroll() {
+ let ops = [
+ Op::AddOutput(3),
+ Op::AddWindow {
+ params: TestWindowParams {
+ is_floating: true,
+ ..TestWindowParams::new(4)
+ },
+ },
+ // This moves the window to tiling.
+ Op::SetFullscreenWindow {
+ window: 4,
+ is_fullscreen: true,
+ },
+ // This starts a DnD scroll since we're dragging a tiled window.
+ Op::InteractiveMoveBegin {
+ window: 4,
+ output_idx: 3,
+ px: 0.0,
+ py: 0.0,
+ },
+ // This will cause the window to unfullscreen to floating, and should stop the DnD scroll
+ // since we're no longer dragging a tiled window, but rather a floating one.
+ Op::InteractiveMoveUpdate {
+ window: 4,
+ dx: 0.0,
+ dy: 15035.31210741684,
+ output_idx: 3,
+ px: 0.0,
+ py: 0.0,
+ },
+ Op::InteractiveMoveEnd { window: 4 },
+ ];
+
+ check_ops(&ops);
+}
+
fn parent_id_causes_loop(layout: &Layout<TestWindow>, id: usize, mut parent_id: usize) -> bool {
if parent_id == id {
return true;