From ddcac86d1d568463ef828bf370d8989bbf12c9fd Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Wed, 5 Feb 2025 09:33:44 +0300 Subject: mapped: Add needs_configure flag Allows to de-duplicate configures from requests that require one. --- src/tests/floating.rs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/tests') diff --git a/src/tests/floating.rs b/src/tests/floating.rs index 8b63d55d..81e507f1 100644 --- a/src/tests/floating.rs +++ b/src/tests/floating.rs @@ -854,3 +854,30 @@ window-rule { @"size: 300 × 100, bounds: 1920 × 1080, states: [Activated]" ); } + +#[test] +fn unfullscreen_to_floating_doesnt_send_extra_configure() { + let (mut f, id, surface) = set_up(); + + // Make it floating. + f.niri().layout.toggle_window_floating(None); + f.roundtrip(id); + + // Fullscreen. + let window = f.client(id).window(&surface); + window.set_fullscreen(None); + f.double_roundtrip(id); + + let _ = f.client(id).window(&surface).recent_configures(); + + // Unfullscreen via the window request which requires a configure response. + let window = f.client(id).window(&surface); + window.unset_fullscreen(); + f.double_roundtrip(id); + + // This should configure only once and not twice. + assert_snapshot!( + f.client(id).window(&surface).format_recent_configures(), + @"size: 936 × 1048, bounds: 1920 × 1080, states: [Activated]" + ); +} -- cgit