2 # vim:ts=4:sw=4:expandtab
4 # Tests if the WM_TAKE_FOCUS protocol is correctly handled by i3
8 subtest 'Window without WM_TAKE_FOCUS', sub {
11 my $window = open_window;
13 ok(!wait_for_event(1, sub { $_[0]->{response_type} == 161 }), 'did not receive ClientMessage');
18 subtest 'Window with WM_TAKE_FOCUS', sub {
21 my $take_focus = $x->atom(name => 'WM_TAKE_FOCUS');
23 my $window = open_window({
25 protocols => [ $take_focus ],
30 ok(wait_for_event(1, sub {
31 return 0 unless $_[0]->{response_type} == 161;
32 my ($data, $time) = unpack("L2", $_[0]->{data});
33 return ($data == $take_focus->id);
34 }), 'got ClientMessage with WM_TAKE_FOCUS atom');