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 # Verifies a ConfigureWindow request with stack-mode=Above is translated into
18 # focusing the target window by i3.
20 # Bug still in: 4.13-207-gafdf6792
22 use X11::XCB qw(CONFIG_WINDOW_STACK_MODE STACK_MODE_ABOVE);
24 my $ws = fresh_workspace;
25 my $left_window = open_window;
26 my $right_window = open_window;
28 is($x->input_focus, $right_window->id, 'right window has focus');
29 my $old_focus = get_focused($ws);
31 $x->configure_window($left_window->id, CONFIG_WINDOW_STACK_MODE, (STACK_MODE_ABOVE));
36 is($x->input_focus, $left_window->id, 'left window has focus');
37 isnt(get_focused($ws), $old_focus, 'right window is no longer focused');
39 ################################################################################
40 # Verify the ConfigureWindow request is only applied when on the active
42 ################################################################################
44 $ws = fresh_workspace;
45 my $new_window = open_window;
47 is($x->input_focus, $new_window->id, 'new window has focus');
48 $x->configure_window($left_window->id, CONFIG_WINDOW_STACK_MODE, (STACK_MODE_ABOVE));
53 is($x->input_focus, $new_window->id, 'new window still has focus');