2 # vim:ts=4:sw=4:expandtab
4 # Tests if the WM_TAKE_FOCUS protocol is correctly handled by i3
10 my $x = X11::XCB::Connection->new;
12 subtest 'Window without WM_TAKE_FOCUS', sub {
15 my $window = open_window($x);
17 ok(!wait_for_event($x, 1, sub { $_[0]->{response_type} == 161 }), 'did not receive ClientMessage');
22 subtest 'Window with WM_TAKE_FOCUS', sub {
25 my $take_focus = $x->atom(name => 'WM_TAKE_FOCUS');
27 my $window = open_window($x, {
29 protocols => [ $take_focus ],
34 ok(wait_for_event($x, 1, sub {
35 return 0 unless $_[0]->{response_type} == 161;
36 my ($data, $time) = unpack("L2", $_[0]->{data});
37 return ($data == $take_focus->id);
38 }), 'got ClientMessage with WM_TAKE_FOCUS atom');