2 # vim:ts=4:sw=4:expandtab
3 # Beware that this test uses workspace 9 and 10 to perform some tests (it expects
4 # the workspace to be empty).
5 # TODO: skip it by default?
9 use Time::HiRes qw(sleep);
12 use_ok('X11::XCB::Connection') or BAIL_OUT('Cannot load X11::XCB::Connection');
15 my $x = X11::XCB::Connection->new;
18 # Switch to the nineth workspace
19 $i3->command('9')->recv;
21 #####################################################################
22 # Create a parent window
23 #####################################################################
25 my $window = $x->root->create_child(
26 class => WINDOW_CLASS_INPUT_OUTPUT,
27 rect => [ 0, 0, 30, 30 ],
28 background_color => '#C0C0C0',
31 $window->name('Parent window');
36 #########################################################################
37 # Switch workspace to 10 and open a child window. It should be positioned
39 #########################################################################
40 $i3->command('10')->recv;
42 my $child = $x->root->create_child(
43 class => WINDOW_CLASS_INPUT_OUTPUT,
44 rect => [ 0, 0, 30, 30 ],
45 background_color => '#C0C0C0',
48 $child->name('Child window');
49 $child->client_leader($window);
54 isnt($x->input_focus, $child->id, "Child window focused");
57 $i3->command('9')->recv;
59 is($x->input_focus, $child->id, "Child window focused");