mirror of
https://github.com/i3/i3.git
synced 2026-02-04 08:05:29 +00:00
t/133-size-hints: synchronize with i3 before inspecting X11 windows
related to https://github.com/i3/i3/issues/3009
This commit is contained in:
committed by
Michael Stapelberg
parent
71dd66f3d9
commit
be440e0146
@ -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');
|
||||
|
||||
Reference in New Issue
Block a user