From be440e0146f48ab45af2b7840a49da79af6c2966 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Mon, 22 Dec 2025 15:31:47 +0100 Subject: [PATCH] t/133-size-hints: synchronize with i3 before inspecting X11 windows related to https://github.com/i3/i3/issues/3009 --- testcases/t/133-size-hints.t | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/testcases/t/133-size-hints.t b/testcases/t/133-size-hints.t index ceb8ffca..f77708a5 100644 --- a/testcases/t/133-size-hints.t +++ b/testcases/t/133-size-hints.t @@ -51,23 +51,27 @@ my $ar = $rect->width / $rect->height; cmp_float($ar, 2, 'Window set to floating with aspect ratio 2.0'); cmd 'resize set 100'; +sync_with_i3; $rect = $win->rect; $ar = $rect->width / $rect->height; cmp_float($ar, 2, 'Window resized with aspect ratio kept to 2.0'); cmd 'resize set 400 100'; +sync_with_i3; $rect = $win->rect; $ar = $rect->width / $rect->height; cmp_float($ar, 2, 'Window resized with aspect ratio kept to 2.0'); # Also check that it is possible to resize by height only cmd 'resize set height 400'; +sync_with_i3; $rect = $win->rect; $ar = $rect->width / $rect->height; is($rect->height, 400, 'Window height is 400px'); cmp_float($ar, 2, 'Window resized with aspect ratio kept to 2.0'); cmd 'resize grow height 10'; +sync_with_i3; $rect = $win->rect; $ar = $rect->width / $rect->height; is($rect->height, 410, 'Window grew by 10px'); @@ -85,6 +89,7 @@ $ar = $rect->width / $rect->height; cmp_float($ar, 1, 'Window set to floating with aspect ratio 1.0'); cmd 'resize set 200'; +sync_with_i3; $rect = $win->rect; $ar = $rect->width / $rect->height; is($rect->width, 200, 'Window width is 200px'); @@ -92,6 +97,7 @@ is($rect->height, 100, 'Window height stayed 100px'); cmp_float($ar, 2, 'Window resized, aspect ratio changed to 2.0'); cmd 'resize set 100 200'; +sync_with_i3; $rect = $win->rect; $ar = $rect->width / $rect->height; is($rect->width, 100, 'Window width is 100px'); @@ -99,11 +105,13 @@ is($rect->height, 200, 'Window height is 200px'); cmp_float($ar, 0.5, 'Window resized, aspect ratio changed to 0.5'); cmd 'resize set 500'; +sync_with_i3; $rect = $win->rect; $ar = $rect->width / $rect->height; cmp_float($ar, 2, 'Window resized, aspect ratio changed to maximum 2.0'); cmd 'resize set 100 400'; +sync_with_i3; $rect = $win->rect; $ar = $rect->width / $rect->height; cmp_float($ar, 0.5, 'Window resized, aspect ratio changed to minimum 0.5');