]> git.sur5r.net Git - i3/i3/blobdiff - testcases/t/33-size-hints.t
Merge branch 'master' into next
[i3/i3] / testcases / t / 33-size-hints.t
index 05897c88aa4e106f59ab575ccab89a9710388601..d2d77e8e0f2ae6abb6b14684776dfcf26b96c62b 100644 (file)
@@ -5,20 +5,13 @@
 #
 use i3test;
 
-my $i3 = i3(get_socket_path());
-
 my $x = X11::XCB::Connection->new;
 
 my $tmp = fresh_workspace;
 
 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
 
-my $win = $x->root->create_child(
-    class => WINDOW_CLASS_INPUT_OUTPUT,
-    rect => X11::XCB::Rect->new(x => 0, y => 0, width => 30, height => 30),
-    background_color => '#C0C0C0',
-);
-
+my $win = open_window($x, { dont_map => 1 });
 # XXX: we should check screen size. in screens with an AR of 2.0,
 # this is not a good idea.
 my $aspect = X11::XCB::Sizehints::Aspect->new;
@@ -28,11 +21,11 @@ $aspect->max_num(600);
 $aspect->max_den(300);
 $win->_create;
 $win->map;
-sleep 0.25;
+wait_for_map $x;
 $win->hints->aspect($aspect);
 $x->flush;
 
-sleep 0.25;
+sync_with_i3($x);
 
 my $rect = $win->rect;
 my $ar = $rect->width / $rect->height;