diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2025-09-02 08:07:22 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2025-09-17 22:04:23 +0300 |
| commit | 35cbab476ebfc271909777029f56f666b29d76a2 (patch) | |
| tree | 65ec759e0f0c6e544c35ee1ca0a938d6c8f06f56 /src/tests | |
| parent | 28d072d893d8cdeed6e697beadf1a712917e52b1 (diff) | |
| download | niri-35cbab476ebfc271909777029f56f666b29d76a2.tar.gz niri-35cbab476ebfc271909777029f56f666b29d76a2.tar.bz2 niri-35cbab476ebfc271909777029f56f666b29d76a2.zip | |
Add unmap-from-floating test
Hits a code path that reads the last acked state after unmapping.
Diffstat (limited to 'src/tests')
| -rw-r--r-- | src/tests/client.rs | 4 | ||||
| -rw-r--r-- | src/tests/floating.rs | 17 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/tests/client.rs b/src/tests/client.rs index d118e472..fc61c2ac 100644 --- a/src/tests/client.rs +++ b/src/tests/client.rs @@ -341,6 +341,10 @@ impl Window { self.surface.attach(Some(&buffer), 0, 0); } + pub fn attach_null(&self) { + self.surface.attach(None, 0, 0); + } + pub fn set_size(&self, w: u16, h: u16) { self.viewport.set_destination(i32::from(w), i32::from(h)); } diff --git a/src/tests/floating.rs b/src/tests/floating.rs index b2eaabfb..4d0b9383 100644 --- a/src/tests/floating.rs +++ b/src/tests/floating.rs @@ -856,6 +856,23 @@ window-rule { } #[test] +fn unmap_from_floating() { + let (mut f, id, surface) = set_up(); + + f.niri().layout.toggle_window_floating(None); + f.double_roundtrip(id); + let _ = f.client(id).window(&surface).recent_configures(); + + // Resize to something different on both axes. + let window = f.client(id).window(&surface); + window.attach_null(); + window.commit(); + + // Shouldn't panic. + f.double_roundtrip(id); +} + +#[test] fn unfullscreen_to_floating_doesnt_send_extra_configure() { let (mut f, id, surface) = set_up(); |
