]> git.sur5r.net Git - i3/i3/blob - testcases/t/138-floating-attach.t
Merge branch 'master' into next
[i3/i3] / testcases / t / 138-floating-attach.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3 # Regression test: New windows were attached to the container of a floating window
4 # if only a floating window is present on the workspace.
5
6 use i3test;
7
8 my $i3 = i3(get_socket_path());
9
10 my $tmp = fresh_workspace;
11
12 #############################################################################
13 # 1: open a floating window, get it mapped
14 #############################################################################
15
16 # Create a floating window
17 my $window = open_floating_window;
18 ok($window->mapped, 'Window is mapped');
19
20 my $ws = get_ws($tmp);
21 my ($nodes, $focus) = get_ws_content($tmp);
22
23 is(@{$ws->{floating_nodes}}, 1, 'one floating node');
24 is(@{$nodes}, 0, 'no tiling nodes');
25
26 # Create a tiling window
27 my $twindow = open_window;
28
29 ($nodes, $focus) = get_ws_content($tmp);
30
31 is(@{$nodes}, 1, 'one tiling node');
32
33 #############################################################################
34 # 2: similar case: floating windows should be attached at the currently focused
35 # position in the workspace (for example a stack), not just at workspace level.
36 #############################################################################
37
38 $tmp = fresh_workspace;
39
40 my $first = open_window;
41 my $second = open_window;
42
43 cmd 'layout stacked';
44
45 $ws = get_ws($tmp);
46 is(@{$ws->{floating_nodes}}, 0, 'no floating nodes so far');
47 is(@{$ws->{nodes}}, 1, 'one tiling node (stacked con)');
48
49 # Create a floating window
50 $window = open_floating_window;
51 ok($window->mapped, 'Window is mapped');
52
53 $ws = get_ws($tmp);
54 is(@{$ws->{floating_nodes}}, 1, 'one floating nodes');
55 is(@{$ws->{nodes}}, 1, 'one tiling node (stacked con)');
56
57 my $third = open_window;
58
59
60 $ws = get_ws($tmp);
61 is(@{$ws->{floating_nodes}}, 1, 'one floating nodes');
62 is(@{$ws->{nodes}}, 1, 'one tiling node (stacked con)');
63
64 done_testing;