aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tests/client.rs4
-rw-r--r--src/tests/floating.rs17
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();