t/189-floating-constraints: sync before getting window rects

This commit is contained in:
Michael Stapelberg 2012-12-26 22:03:37 +01:00
parent 27adbbff61
commit 4d65cfc67d

View File

@ -146,6 +146,7 @@ $window = open_floating_window(rect => [ 0, 0, 100, 100 ]);
cmd 'border none'; cmd 'border none';
cmd 'resize shrink height 80px or 80ppt'; cmd 'resize shrink height 80px or 80ppt';
cmd 'resize shrink width 80px or 80ppt'; cmd 'resize shrink width 80px or 80ppt';
sync_with_i3;
$rect = $window->rect; $rect = $window->rect;
is($rect->{width}, 60, 'width = 60'); is($rect->{width}, 60, 'width = 60');
is($rect->{height}, 50, 'height = 50'); is($rect->{height}, 50, 'height = 50');
@ -170,6 +171,7 @@ $window = open_floating_window(rect => [ 200, 200, 50, 50 ]);
cmd 'border none'; cmd 'border none';
cmd 'resize grow height 100px or 100ppt'; cmd 'resize grow height 100px or 100ppt';
cmd 'resize grow width 100px or 100ppt'; cmd 'resize grow width 100px or 100ppt';
sync_with_i3;
$rect = $window->rect; $rect = $window->rect;
is($rect->{width}, 100, 'width = 100'); is($rect->{width}, 100, 'width = 100');
is($rect->{height}, 100, 'height = 100'); is($rect->{height}, 100, 'height = 100');
@ -177,6 +179,7 @@ is($rect->{height}, 100, 'height = 100');
my $old_x = $rect->{x}; my $old_x = $rect->{x};
my $old_y = $rect->{y}; my $old_y = $rect->{y};
cmd 'resize grow up 10px or 10ppt'; cmd 'resize grow up 10px or 10ppt';
sync_with_i3;
$rect = $window->rect; $rect = $window->rect;
is($rect->{x}, $old_x, 'window did not move when trying to resize'); is($rect->{x}, $old_x, 'window did not move when trying to resize');
is($rect->{y}, $old_y, 'window did not move when trying to resize'); is($rect->{y}, $old_y, 'window did not move when trying to resize');