]> git.sur5r.net Git - i3/i3/blob - testcases/t/56-fullscreen-focus.t
Merge branch 'userguide-mark'
[i3/i3] / testcases / t / 56-fullscreen-focus.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3 #
4 # Test if new containers get focused when there is a fullscreen container at
5 # the time of launching the new one.
6 #
7 use X11::XCB qw(:all);
8 use i3test;
9
10 BEGIN {
11     use_ok('X11::XCB::Window');
12 }
13
14 my $x = X11::XCB::Connection->new;
15 my $i3 = i3(get_socket_path());
16
17 my $tmp = fresh_workspace;
18
19 #####################################################################
20 # open the left window
21 #####################################################################
22
23 my $left = open_standard_window($x, '#ff0000');
24
25 is($x->input_focus, $left->id, 'left window focused');
26
27 diag("left = " . $left->id);
28
29 #####################################################################
30 # Open the right window
31 #####################################################################
32
33 my $right = open_standard_window($x, '#00ff00');
34
35 diag("right = " . $right->id);
36
37 #####################################################################
38 # Set the right window to fullscreen
39 #####################################################################
40 cmd 'nop setting fullscreen';
41 cmd 'fullscreen';
42
43 #####################################################################
44 # Open a third window
45 #####################################################################
46
47 my $third = open_standard_window($x, '#0000ff');
48
49 diag("third = " . $third->id);
50
51 # move the fullscreen window to a different ws
52
53 my $tmp2 = get_unused_workspace;
54
55 cmd "move workspace $tmp2";
56
57 # verify that the third window has the focus
58
59 sleep 0.25;
60
61 is($x->input_focus, $third->id, 'third window focused');
62
63 done_testing;