X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=testcases%2Flib%2Fi3test.pm.in;fp=testcases%2Flib%2Fi3test.pm.in;h=429e51d4187e89b56f027195d51592f06e6bc42c;hb=7208df2d38c9102e8e94d6d5533d705b130f87e3;hp=1e4eea75137c52a584a0f2edc7f1ccdb32cc31f4;hpb=5d55f93eb35d8a0626cef09b8de250b884e06eb8;p=i3%2Fi3 diff --git a/testcases/lib/i3test.pm.in b/testcases/lib/i3test.pm.in index 1e4eea75..429e51d4 100644 --- a/testcases/lib/i3test.pm.in +++ b/testcases/lib/i3test.pm.in @@ -133,6 +133,22 @@ sub import { my ($class, %args) = @_; my $pkg = caller; + $x ||= i3test::X11->new; + # set the pointer to a predictable position in case a previous test has + # disturbed it + $x->warp_pointer( + 0, # src_window (None) + $x->get_root_window(), # dst_window (None) + 0, # src_x + 0, # src_y + 0, # src_width + 0, # src_height + 0, # dst_x + 0); # dst_y + # Synchronize with X11 to ensure the pointer has been warped before i3 + # starts up. + $x->get_input_focus_reply($x->get_input_focus()->{sequence}); + $i3_autostart = delete($args{i3_autostart}) // 1; my $i3_config = delete($args{i3_config}) // '-default'; @@ -155,10 +171,6 @@ __ strict->import; warnings->import; - $x ||= i3test::X11->new; - # set the pointer to a predictable position in case a previous test has - # disturbed it - $x->root->warp_pointer(0, 0); $cv->recv if $i3_autostart; @_ = ($class);