2 # vim:ts=4:sw=4:expandtab
4 # Please read the following documents before working on tests:
5 # • http://build.i3wm.org/docs/testsuite.html
8 # • http://build.i3wm.org/docs/lib-i3test.html
9 # (alternatively: perldoc ./testcases/lib/i3test.pm)
11 # • http://build.i3wm.org/docs/ipc.html
14 # • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
15 # (unless you are already familiar with Perl)
19 use X11::XCB qw(:all);
22 my $cookie = $x->get_property(
24 $x->get_root_window(),
25 $x->atom(name => '_NET_SUPPORTING_WM_CHECK')->id,
26 $x->atom(name => 'WINDOW')->id,
31 my $reply = $x->get_property_reply($cookie->{sequence});
32 my $len = $reply->{length};
33 return undef if $len == 0;
35 return unpack("L", $reply->{value});
38 my $window = open_window;
40 is($x->input_focus, $window->id, 'sanity check: window has input focus');
43 is($x->input_focus, get_ewmh_window(), 'focus falls back to the EWMH window');