2010-06-01 14:52:59 -04:00
|
|
|
#!perl
|
|
|
|
# vim:ts=4:sw=4:expandtab
|
|
|
|
#
|
2012-09-10 08:09:01 -04:00
|
|
|
# Please read the following documents before working on tests:
|
|
|
|
# • http://build.i3wm.org/docs/testsuite.html
|
|
|
|
# (or docs/testsuite)
|
|
|
|
#
|
|
|
|
# • http://build.i3wm.org/docs/lib-i3test.html
|
|
|
|
# (alternatively: perldoc ./testcases/lib/i3test.pm)
|
|
|
|
#
|
|
|
|
# • http://build.i3wm.org/docs/ipc.html
|
|
|
|
# (or docs/ipc)
|
|
|
|
#
|
|
|
|
# • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
|
|
|
|
# (unless you are already familiar with Perl)
|
|
|
|
#
|
2010-06-01 14:52:59 -04:00
|
|
|
# Regression: make a container floating, kill its parent, make it tiling again
|
|
|
|
#
|
2011-03-09 14:25:17 -05:00
|
|
|
use i3test;
|
2010-06-01 14:52:59 -04:00
|
|
|
|
2011-03-09 14:25:17 -05:00
|
|
|
my $tmp = fresh_workspace;
|
2010-06-01 14:52:59 -04:00
|
|
|
|
2011-03-09 14:25:17 -05:00
|
|
|
cmd 'open';
|
2010-11-28 15:11:14 -05:00
|
|
|
my $left = get_focused($tmp);
|
2011-03-09 14:25:17 -05:00
|
|
|
cmd 'open';
|
2010-06-01 14:52:59 -04:00
|
|
|
my $old = get_focused($tmp);
|
2011-03-09 14:25:17 -05:00
|
|
|
cmd 'split v';
|
|
|
|
cmd 'open';
|
2010-06-01 14:52:59 -04:00
|
|
|
my $floating = get_focused($tmp);
|
|
|
|
diag("focused floating: " . get_focused($tmp));
|
2011-03-09 14:25:17 -05:00
|
|
|
cmd 'mode toggle';
|
2011-11-23 06:57:13 -05:00
|
|
|
sync_with_i3;
|
2010-11-28 15:11:14 -05:00
|
|
|
|
|
|
|
# kill old container
|
2011-03-09 14:25:17 -05:00
|
|
|
cmd qq|[con_id="$old"] focus|;
|
2010-06-01 14:52:59 -04:00
|
|
|
is(get_focused($tmp), $old, 'old container focused');
|
2011-03-09 14:25:17 -05:00
|
|
|
cmd 'kill';
|
2010-11-28 15:11:14 -05:00
|
|
|
|
|
|
|
# kill left container
|
2011-03-09 14:25:17 -05:00
|
|
|
cmd qq|[con_id="$left"] focus|;
|
2010-11-28 15:11:14 -05:00
|
|
|
is(get_focused($tmp), $left, 'old container focused');
|
2011-03-09 14:25:17 -05:00
|
|
|
cmd 'kill';
|
2010-11-28 15:11:14 -05:00
|
|
|
|
|
|
|
# focus floating window, make it tiling again
|
2011-03-09 14:25:17 -05:00
|
|
|
cmd qq|[con_id="$floating"] focus|;
|
2010-06-01 14:52:59 -04:00
|
|
|
is(get_focused($tmp), $floating, 'floating window focused');
|
|
|
|
|
2011-11-23 06:57:13 -05:00
|
|
|
sync_with_i3;
|
2011-03-09 14:25:17 -05:00
|
|
|
cmd 'mode toggle';
|
2010-06-01 14:52:59 -04:00
|
|
|
|
2011-01-27 19:21:38 -05:00
|
|
|
does_i3_live;
|
2010-06-01 14:52:59 -04:00
|
|
|
|
2011-03-09 14:25:17 -05:00
|
|
|
done_testing;
|