]> git.sur5r.net Git - i3/i3/blobdiff - testcases/t/158-wm_take_focus.t
Merge branch 'master' into next
[i3/i3] / testcases / t / 158-wm_take_focus.t
index a90ce1c3d04641cb6e18a8167cad7a7b4931f13e..94476bbd857d3cd1d08d86c92eecdf02dfaed882 100644 (file)
@@ -3,18 +3,14 @@
 #
 # Tests if the WM_TAKE_FOCUS protocol is correctly handled by i3
 #
-use X11::XCB qw(:all);
 use i3test;
-use v5.10;
-
-my $x = X11::XCB::Connection->new;
 
 subtest 'Window without WM_TAKE_FOCUS', sub {
     fresh_workspace;
 
-    my $window = open_window($x);
+    my $window = open_window;
 
-    ok(!wait_for_event($x, 1, sub { $_[0]->{response_type} == 161 }), 'did not receive ClientMessage');
+    ok(!wait_for_event(1, sub { $_[0]->{response_type} == 161 }), 'did not receive ClientMessage');
 
     done_testing;
 };
@@ -24,14 +20,14 @@ subtest 'Window with WM_TAKE_FOCUS', sub {
 
     my $take_focus = $x->atom(name => 'WM_TAKE_FOCUS');
 
-    my $window = open_window($x, {
+    my $window = open_window({
         dont_map => 1,
         protocols => [ $take_focus ],
     });
 
     $window->map;
 
-    ok(wait_for_event($x, 1, sub {
+    ok(wait_for_event(1, sub {
         return 0 unless $_[0]->{response_type} == 161;
         my ($data, $time) = unpack("L2", $_[0]->{data});
         return ($data == $take_focus->id);