diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2025-02-15 13:11:34 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2025-02-15 13:28:57 +0300 |
| commit | ca1500ae90f33344fe776898ae11137bf7d1ecc1 (patch) | |
| tree | 75bd257aae6da74f14e6b5f4097c5e7778414f49 /src/layout/tests.rs | |
| parent | d7f3ca00c70b264032025c262b3c0b10e67c04be (diff) | |
| download | niri-ca1500ae90f33344fe776898ae11137bf7d1ecc1.tar.gz niri-ca1500ae90f33344fe776898ae11137bf7d1ecc1.tar.bz2 niri-ca1500ae90f33344fe776898ae11137bf7d1ecc1.zip | |
Implement scrolling the view during DnD
DnD is external to the layout, so we just inform it when one is ongoing.
Diffstat (limited to 'src/layout/tests.rs')
| -rw-r--r-- | src/layout/tests.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/layout/tests.rs b/src/layout/tests.rs index ecb9d683..813f4765 100644 --- a/src/layout/tests.rs +++ b/src/layout/tests.rs @@ -589,6 +589,15 @@ enum Op { #[proptest(strategy = "1..=5usize")] window: usize, }, + DndUpdate { + #[proptest(strategy = "1..=5usize")] + output_idx: usize, + #[proptest(strategy = "-20000f64..20000f64")] + px: f64, + #[proptest(strategy = "-20000f64..20000f64")] + py: f64, + }, + DndEnd, InteractiveResizeBegin { #[proptest(strategy = "1..=5usize")] window: usize, @@ -1353,6 +1362,16 @@ impl Op { Op::InteractiveMoveEnd { window } => { layout.interactive_move_end(&window); } + Op::DndUpdate { output_idx, px, py } => { + let name = format!("output{output_idx}"); + let Some(output) = layout.outputs().find(|o| o.name() == name).cloned() else { + return; + }; + layout.dnd_update(output, Point::from((px, py))); + } + Op::DndEnd => { + layout.dnd_end(); + } Op::InteractiveResizeBegin { window, edges } => { layout.interactive_resize_begin(window, edges); } |
