2010-06-01 20:52:59 +02:00
|
|
|
#!perl
|
|
|
|
# vim:ts=4:sw=4:expandtab
|
|
|
|
#
|
|
|
|
# Regression: make a container floating, kill its parent, make it tiling again
|
|
|
|
#
|
2010-11-28 21:11:14 +01:00
|
|
|
use i3test tests => 4;
|
2010-06-01 20:52:59 +02:00
|
|
|
use X11::XCB qw(:all);
|
|
|
|
|
|
|
|
my $i3 = i3("/tmp/nestedcons");
|
|
|
|
|
|
|
|
my $tmp = get_unused_workspace();
|
|
|
|
$i3->command("workspace $tmp")->recv;
|
|
|
|
|
|
|
|
$i3->command('open')->recv;
|
2010-11-28 21:11:14 +01:00
|
|
|
my $left = get_focused($tmp);
|
2010-06-01 20:52:59 +02:00
|
|
|
$i3->command('open')->recv;
|
|
|
|
my $old = get_focused($tmp);
|
|
|
|
$i3->command('split v')->recv;
|
|
|
|
$i3->command('open')->recv;
|
|
|
|
my $floating = get_focused($tmp);
|
|
|
|
diag("focused floating: " . get_focused($tmp));
|
|
|
|
$i3->command('mode toggle')->recv;
|
|
|
|
# TODO: eliminate this race conditition
|
|
|
|
sleep 1;
|
2010-11-28 21:11:14 +01:00
|
|
|
|
|
|
|
# kill old container
|
2010-06-01 20:52:59 +02:00
|
|
|
$i3->command(qq|[con_id="$old"] focus|)->recv;
|
|
|
|
is(get_focused($tmp), $old, 'old container focused');
|
|
|
|
$i3->command('kill')->recv;
|
2010-11-28 21:11:14 +01:00
|
|
|
|
|
|
|
# kill left container
|
|
|
|
$i3->command(qq|[con_id="$left"] focus|)->recv;
|
|
|
|
is(get_focused($tmp), $left, 'old container focused');
|
2010-06-01 20:52:59 +02:00
|
|
|
$i3->command('kill')->recv;
|
2010-11-28 21:11:14 +01:00
|
|
|
|
|
|
|
# focus floating window, make it tiling again
|
2010-06-01 20:52:59 +02:00
|
|
|
$i3->command(qq|[con_id="$floating"] focus|)->recv;
|
|
|
|
is(get_focused($tmp), $floating, 'floating window focused');
|
|
|
|
|
|
|
|
sleep 1;
|
|
|
|
$i3->command('mode toggle')->recv;
|
|
|
|
|
2011-01-28 01:21:38 +01:00
|
|
|
does_i3_live;
|
2010-06-01 20:52:59 +02:00
|
|
|
|
|
|
|
diag( "Testing i3, Perl $], $^X" );
|