]> git.sur5r.net Git - i3/i3/blobdiff - testcases/t/158-wm_take_focus.t
t/158-wm_take_focus: use sync_with_i3 instead of a timeout
[i3/i3] / testcases / t / 158-wm_take_focus.t
index 94476bbd857d3cd1d08d86c92eecdf02dfaed882..c4d305750183b9f020cc939f9740e132100a903c 100644 (file)
@@ -9,8 +9,10 @@ subtest 'Window without WM_TAKE_FOCUS', sub {
     fresh_workspace;
 
     my $window = open_window;
-
-    ok(!wait_for_event(1, sub { $_[0]->{response_type} == 161 }), 'did not receive ClientMessage');
+    # sync_with_i3 will send a ClientMessage to i3 and receive one targeted to
+    # $window->id. If it receives WM_TAKE_FOCUS instead, it will return 0, thus
+    # the test will fail.
+    ok(sync_with_i3(window_id => $window->id), 'did not receive ClientMessage');
 
     done_testing;
 };