2 # vim:ts=4:sw=4:expandtab
4 # Regression: make a container floating, kill its parent, make it tiling again
9 my $i3 = i3("/tmp/nestedcons");
11 my $tmp = get_unused_workspace();
12 $i3->command("workspace $tmp")->recv;
14 $i3->command('open')->recv;
15 my $left = get_focused($tmp);
16 $i3->command('open')->recv;
17 my $old = get_focused($tmp);
18 $i3->command('split v')->recv;
19 $i3->command('open')->recv;
20 my $floating = get_focused($tmp);
21 diag("focused floating: " . get_focused($tmp));
22 $i3->command('mode toggle')->recv;
23 # TODO: eliminate this race conditition
27 $i3->command(qq|[con_id="$old"] focus|)->recv;
28 is(get_focused($tmp), $old, 'old container focused');
29 $i3->command('kill')->recv;
32 $i3->command(qq|[con_id="$left"] focus|)->recv;
33 is(get_focused($tmp), $left, 'old container focused');
34 $i3->command('kill')->recv;
36 # focus floating window, make it tiling again
37 $i3->command(qq|[con_id="$floating"] focus|)->recv;
38 is(get_focused($tmp), $floating, 'floating window focused');
41 $i3->command('mode toggle')->recv;
43 my $tree = $i3->get_tree->recv;
44 my @nodes = @{$tree->{nodes}};
45 ok(@nodes > 0, 'i3 still lives');
47 diag( "Testing i3, Perl $], $^X" );