From: Michael Stapelberg Date: Sat, 17 Sep 2011 13:12:16 +0000 (+0100) Subject: Tests: fix floating size, add a test to check floating size when starting in tiling X-Git-Tag: 4.1~158^2^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7a43af04afb645ce5328f96fb92e59d65b25668a;p=i3%2Fi3 Tests: fix floating size, add a test to check floating size when starting in tiling --- diff --git a/testcases/t/04-floating.t b/testcases/t/04-floating.t index d4aea828..fcf73f08 100644 --- a/testcases/t/04-floating.t +++ b/testcases/t/04-floating.t @@ -51,7 +51,7 @@ sleep 0.25; ($absolute, $top) = $window->rect; cmp_ok($absolute->{width}, '==', 80, "i3 let the width at 80"); -cmp_ok($absolute->{height}, '==', 92, "i3 let the height at 90"); +cmp_ok($absolute->{height}, '==', 90, "i3 let the height at 90"); # We need to compare the position with decorations due to the way # we do decoration rendering (on the parent frame) in the tree branch @@ -60,4 +60,31 @@ cmp_ok($top->{y}, '==', 19, 'i3 mapped it to y=18'); $window->unmap; +##################################################################### +# check that a tiling window which is then made floating still has +# at least the size of its initial geometry +##################################################################### + +$window = $x->root->create_child( + class => WINDOW_CLASS_INPUT_OUTPUT, + rect => [ 1, 1, 80, 90], + background_color => '#C0C0C0', + #window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_UTILITY'), +); + +isa_ok($window, 'X11::XCB::Window'); + +$window->map; + +sleep 0.25; + +cmd 'floating enable'; + +($absolute, $top) = $window->rect; + +cmp_ok($absolute->{width}, '==', 80, "i3 let the width at 80"); +cmp_ok($absolute->{height}, '==', 90, "i3 let the height at 90"); + +$window->unmap; + done_testing;