2 # vim:ts=4:sw=4:expandtab
3 # Beware that this test uses workspace 9 to perform some tests (it expects
4 # the workspace to be empty).
5 # TODO: skip it by default?
11 use_ok('X11::XCB::Connection') or BAIL_OUT('Cannot load X11::XCB::Connection');
14 my $x = X11::XCB::Connection->new;
18 #####################################################################
19 # Create a floating window and see if resizing works
20 #####################################################################
22 # Create a floating window
23 my $window = $x->root->create_child(
24 class => WINDOW_CLASS_INPUT_OUTPUT,
25 rect => [ 0, 0, 30, 30],
26 background_color => '#C0C0C0',
27 # replace the type with 'utility' as soon as the coercion works again in X11::XCB
28 window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_UTILITY'),
31 isa_ok($window, 'X11::XCB::Window');
36 # See if configurerequests cause window movements (they should not)
37 my ($a, $t) = $window->rect;
38 $window->rect(X11::XCB::Rect->new(x => $a->x, y => $a->y, width => $a->width, height => $a->height));
41 my ($na, $nt) = $window->rect;
42 is_deeply($na, $a, 'Rects are equal after configurerequest');
45 $window->rect(X11::XCB::Rect->new(x => 0, y => 0, width => 100, height => 100));
47 my ($absolute, $top) = $window->rect;
49 # Make sure the width/height are different from what we’re gonna test, so
50 # that the test will work.
51 isnt($absolute->width, 300, 'width != 300');
52 isnt($absolute->height, 500, 'height != 500');
54 $window->rect(X11::XCB::Rect->new(x => 0, y => 0, width => 300, height => 500));
57 ($absolute, $top) = $window->rect;
59 is($absolute->width, 300, 'width = 300');
60 is($absolute->height, 500, 'height = 500');
63 # Test with default border
71 # Test with 1-px-border