]> git.sur5r.net Git - i3/i3/blob - testcases/t/156-fullscreen-focus.t
Merge branch 'doc-fixes'
[i3/i3] / testcases / t / 156-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_window($x, { background_color => '#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_window($x, { background_color => '#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_window($x, {
48         background_color => '#0000ff',
49         name => 'Third window',
50         dont_map => 1,
51     });
52
53 $third->map;
54
55 sync_with_i3 $x;
56
57 diag("third = " . $third->id);
58
59 # move the fullscreen window to a different ws
60
61 my $tmp2 = get_unused_workspace;
62
63 cmd "move workspace $tmp2";
64
65 # verify that the third window has the focus
66
67 sync_with_i3($x);
68
69 is($x->input_focus, $third->id, 'third window focused');
70
71 done_testing;