]> git.sur5r.net Git - i3/i3/blob - testcases/t/56-fullscreen-focus.t
When leaving fullscreen, set focus to con which was opened during fullscreen (+testca...
[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 Time::HiRes qw(sleep);
9 use i3test;
10
11 BEGIN {
12     use_ok('X11::XCB::Window');
13 }
14
15 my $x = X11::XCB::Connection->new;
16 my $i3 = i3("/tmp/nestedcons");
17
18 my $tmp = get_unused_workspace;
19 cmd "workspace $tmp";
20
21 #####################################################################
22 # open the left window
23 #####################################################################
24
25 my $left = open_standard_window($x, '#ff0000');
26
27 is($x->input_focus, $left->id, 'left window focused');
28
29 diag("left = " . $left->id);
30
31 #####################################################################
32 # Open the right window
33 #####################################################################
34
35 my $right = open_standard_window($x, '#00ff00');
36
37 diag("right = " . $right->id);
38
39 #####################################################################
40 # Set the right window to fullscreen
41 #####################################################################
42 cmd 'nop setting fullscreen';
43 cmd 'fullscreen';
44
45 #####################################################################
46 # Open a third window
47 #####################################################################
48
49 my $third = open_standard_window($x, '#0000ff');
50
51 diag("third = " . $third->id);
52
53 # move the fullscreen window to a different ws
54
55 my $tmp2 = get_unused_workspace;
56
57 cmd "move workspace $tmp2";
58
59 # verify that the third window has the focus
60
61 sleep 0.25;
62
63 is($x->input_focus, $third->id, 'third window focused');
64
65 done_testing;