]> git.sur5r.net Git - i3/i3/blob - testcases/t/269-focus-stack-above.t
Merge "force_focus_wrapping" option into "focus_wrapping force"
[i3/i3] / testcases / t / 269-focus-stack-above.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3 #
4 # Please read the following documents before working on tests:
5 # • http://build.i3wm.org/docs/testsuite.html
6 #   (or docs/testsuite)
7 #
8 # • http://build.i3wm.org/docs/lib-i3test.html
9 #   (alternatively: perldoc ./testcases/lib/i3test.pm)
10 #
11 # • http://build.i3wm.org/docs/ipc.html
12 #   (or docs/ipc)
13 #
14 # • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
15 #   (unless you are already familiar with Perl)
16 #
17 # Verifies a ConfigureWindow request with stack-mode=Above is translated into
18 # focusing the target window by i3.
19 # Ticket: #2708
20 # Bug still in: 4.13-207-gafdf6792
21 use i3test;
22 use X11::XCB qw(CONFIG_WINDOW_STACK_MODE STACK_MODE_ABOVE);
23
24 my $ws = fresh_workspace;
25 my $left_window = open_window;
26 my $right_window = open_window;
27
28 is($x->input_focus, $right_window->id, 'right window has focus');
29 my $old_focus = get_focused($ws);
30
31 $x->configure_window($left_window->id, CONFIG_WINDOW_STACK_MODE, (STACK_MODE_ABOVE));
32 $x->flush;
33
34 sync_with_i3;
35
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');
38
39 ################################################################################
40 # Verify the ConfigureWindow request is only applied when on the active
41 # workspace.
42 ################################################################################
43
44 $ws = fresh_workspace;
45 my $new_window = open_window;
46
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));
49 $x->flush;
50
51 sync_with_i3;
52
53 is($x->input_focus, $new_window->id, 'new window still has focus');
54
55 done_testing;