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?
7 use Test::More tests => 3;
11 use Time::HiRes qw(sleep);
13 use Digest::SHA1 qw(sha1_base64);
14 use lib "$FindBin::Bin/lib";
19 use_ok('X11::XCB::Connection') or BAIL_OUT('Cannot load X11::XCB::Connection');
22 my $x = X11::XCB::Connection->new;
25 # Switch to the nineth workspace
26 $i3->command('9')->recv;
28 #####################################################################
29 # Create a parent window
30 #####################################################################
32 my $window = $x->root->create_child(
33 class => WINDOW_CLASS_INPUT_OUTPUT,
34 rect => [ 0, 0, 30, 30 ],
35 background_color => '#C0C0C0',
38 $window->name('Parent window');
43 #########################################################################
44 # Switch workspace to 10 and open a child window. It should be positioned
46 #########################################################################
47 $i3->command('10')->recv;
49 my $child = $x->root->create_child(
50 class => WINDOW_CLASS_INPUT_OUTPUT,
51 rect => [ 0, 0, 30, 30 ],
52 background_color => '#C0C0C0',
55 $child->name('Child window');
56 $child->client_leader($window);
61 isnt($x->input_focus, $child->id, "Child window focused");
64 $i3->command('9')->recv;
66 is($x->input_focus, $child->id, "Child window focused");