2 # vim:ts=4:sw=4:expandtab
3 # Checks if the focus is correctly restored, when creating a floating client
4 # over an unfocused tiling client and destroying the floating one again.
10 use_ok('X11::XCB::Window') or BAIL_OUT('Could not load X11::XCB::Window');
13 my $x = X11::XCB::Connection->new;
15 my $i3 = i3(get_socket_path());
19 my $tiled_left = open_standard_window($x);
20 my $tiled_right = open_standard_window($x);
24 # Get input focus before creating the floating window
25 my $focus = $x->input_focus;
27 # Create a floating window which is smaller than the minimum enforced size of i3
28 my $window = $x->root->create_child(
29 class => WINDOW_CLASS_INPUT_OUTPUT,
30 rect => [ 1, 1, 30, 30],
31 background_color => '#C0C0C0',
32 type => $x->atom(name => '_NET_WM_WINDOW_TYPE_UTILITY'),
35 isa_ok($window, 'X11::XCB::Window');
41 is($x->input_focus, $window->id, 'floating window focused');
47 is($x->input_focus, $focus, 'Focus correctly restored');