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.
8 my $i3 = i3(get_socket_path());
10 my $tmp = fresh_workspace;
12 #############################################################################
13 # 1: open a floating window, get it mapped
14 #############################################################################
16 # Create a floating window
17 my $window = open_floating_window;
18 ok($window->mapped, 'Window is mapped');
20 my $ws = get_ws($tmp);
21 my ($nodes, $focus) = get_ws_content($tmp);
23 is(@{$ws->{floating_nodes}}, 1, 'one floating node');
24 is(@{$nodes}, 0, 'no tiling nodes');
26 # Create a tiling window
27 my $twindow = open_window;
29 ($nodes, $focus) = get_ws_content($tmp);
31 is(@{$nodes}, 1, 'one tiling node');
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 #############################################################################
38 $tmp = fresh_workspace;
40 my $first = open_window;
41 my $second = open_window;
46 is(@{$ws->{floating_nodes}}, 0, 'no floating nodes so far');
47 is(@{$ws->{nodes}}, 1, 'one tiling node (stacked con)');
49 # Create a floating window
50 $window = open_floating_window;
51 ok($window->mapped, 'Window is mapped');
54 is(@{$ws->{floating_nodes}}, 1, 'one floating nodes');
55 is(@{$ws->{nodes}}, 1, 'one tiling node (stacked con)');
57 my $third = open_window;
61 is(@{$ws->{floating_nodes}}, 1, 'one floating nodes');
62 is(@{$ws->{nodes}}, 1, 'one tiling node (stacked con)');