2011-01-27 17:23:29 +01:00
|
|
|
#!perl
|
|
|
|
# vim:ts=4:sw=4:expandtab
|
|
|
|
#
|
|
|
|
use X11::XCB qw(:all);
|
2011-03-09 20:25:17 +01:00
|
|
|
use i3test;
|
2011-01-27 17:23:29 +01:00
|
|
|
|
|
|
|
BEGIN {
|
|
|
|
use_ok('X11::XCB::Window');
|
|
|
|
}
|
|
|
|
|
|
|
|
my $x = X11::XCB::Connection->new;
|
|
|
|
|
2011-03-09 20:25:17 +01:00
|
|
|
my $tmp = fresh_workspace;
|
2011-01-27 17:23:29 +01:00
|
|
|
|
2011-09-24 16:11:37 +02:00
|
|
|
my $left = open_window($x);
|
|
|
|
my $mid = open_window($x);
|
2011-01-27 17:23:29 +01:00
|
|
|
|
|
|
|
cmd 'split v';
|
2011-09-24 16:11:37 +02:00
|
|
|
my $bottom = open_window($x);
|
2011-01-27 17:23:29 +01:00
|
|
|
|
|
|
|
my ($nodes, $focus) = get_ws_content($tmp);
|
|
|
|
|
|
|
|
#############################################################################
|
|
|
|
# 1: open a floating window, get it mapped
|
|
|
|
#############################################################################
|
|
|
|
|
|
|
|
# Create a floating window
|
2011-09-24 16:11:37 +02:00
|
|
|
my $window = open_floating_window($x);
|
2011-01-27 17:23:29 +01:00
|
|
|
ok($window->mapped, 'Window is mapped');
|
|
|
|
|
|
|
|
($nodes, $focus) = get_ws_content($tmp);
|
|
|
|
is(@{$nodes->[1]->{nodes}}, 2, 'two windows in split con');
|
|
|
|
|
|
|
|
#############################################################################
|
|
|
|
# 2: make it tiling, see where it ends up
|
|
|
|
#############################################################################
|
|
|
|
|
2011-06-10 02:06:47 +02:00
|
|
|
cmd 'floating toggle';
|
2011-01-27 17:23:29 +01:00
|
|
|
|
|
|
|
my ($nodes, $focus) = get_ws_content($tmp);
|
|
|
|
|
2011-06-10 02:06:47 +02:00
|
|
|
is(@{$nodes->[1]->{nodes}}, 3, 'three windows in split con after floating toggle');
|
2011-03-09 20:25:17 +01:00
|
|
|
|
|
|
|
done_testing;
|