From 7a43af04afb645ce5328f96fb92e59d65b25668a Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 17 Sep 2011 14:12:16 +0100 Subject: [PATCH] Tests: fix floating size, add a test to check floating size when starting in tiling --- testcases/t/04-floating.t | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) 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; -- 2.39.5