t/158-wm_take_focus: use sync_with_i3 instead of a timeout

This commit is contained in:
Michael Stapelberg
2012-02-21 14:37:55 +01:00
parent 41400d8a16
commit d085e88d02
2 changed files with 10 additions and 4 deletions

View 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;
};