2 # vim:ts=4:sw=4:expandtab
5 use Time::HiRes qw(sleep);
9 use_ok('X11::XCB::Window');
12 my $x = X11::XCB::Connection->new;
14 my $tmp = fresh_workspace;
16 my $left = open_standard_window($x);
18 my $mid = open_standard_window($x);
22 my $bottom = open_standard_window($x);
25 my ($nodes, $focus) = get_ws_content($tmp);
27 #############################################################################
28 # 1: open a floating window, get it mapped
29 #############################################################################
31 my $x = X11::XCB::Connection->new;
33 # Create a floating window
34 my $window = $x->root->create_child(
35 class => WINDOW_CLASS_INPUT_OUTPUT,
36 rect => [ 0, 0, 30, 30],
37 background_color => '#C0C0C0',
38 # replace the type with 'utility' as soon as the coercion works again in X11::XCB
39 window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_UTILITY'),
42 isa_ok($window, 'X11::XCB::Window');
48 ok($window->mapped, 'Window is mapped');
50 ($nodes, $focus) = get_ws_content($tmp);
51 is(@{$nodes->[1]->{nodes}}, 2, 'two windows in split con');
53 #############################################################################
54 # 2: make it tiling, see where it ends up
55 #############################################################################
57 cmd 'floating toggle';
59 my ($nodes, $focus) = get_ws_content($tmp);
61 is(@{$nodes->[1]->{nodes}}, 3, 'three windows in split con after floating toggle');