2 # vim:ts=4:sw=4:expandtab
4 # Please read the following documents before working on tests:
5 # • https://build.i3wm.org/docs/testsuite.html
8 # • https://build.i3wm.org/docs/lib-i3test.html
9 # (alternatively: perldoc ./testcases/lib/i3test.pm)
11 # • https://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)
17 # Ensures the urgency hint is cleared properly in the case where i3 set it (due
18 # to focus_on_window_activation=urgent), hence the application not clearing it.
20 # Bug still in: 4.10.3-253-g03799dd
21 use i3test i3_config => <<EOT;
23 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
25 focus_on_window_activation urgent
28 sub send_net_active_window {
31 my $msg = pack "CCSLLLLLLL",
32 X11::XCB::CLIENT_MESSAGE, # response_type
35 $id, # destination window
36 $x->atom(name => '_NET_ACTIVE_WINDOW')->id,
40 $x->send_event(0, $x->get_root_window(), X11::XCB::EVENT_MASK_SUBSTRUCTURE_REDIRECT, $msg);
43 my $ws = fresh_workspace;
44 my $first = open_window;
45 my $second = open_window;
47 send_net_active_window($first->id);
49 is($x->input_focus, $second->id, 'second window still focused');
51 cmd '[urgent=latest] focus';
53 is($x->input_focus, $first->id, 'first window focused');
57 is($x->input_focus, $second->id, 'second window focused again');
59 cmd '[urgent=latest] focus';
61 is($x->input_focus, $second->id, 'second window still focused');