]> git.sur5r.net Git - i3/i3/blob - testcases/t/37-floating-unmap.t
Merge branch 'master' into next
[i3/i3] / testcases / t / 37-floating-unmap.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3 # Regression test: Floating windows were not correctly unmapped when switching
4 # to a different workspace.
5
6 use i3test;
7 use X11::XCB qw(:all);
8
9 BEGIN {
10     use_ok('X11::XCB::Window');
11 }
12
13 my $i3 = i3(get_socket_path());
14
15 my $tmp = fresh_workspace;
16
17 #############################################################################
18 # 1: open a floating window, get it mapped
19 #############################################################################
20
21 my $x = X11::XCB::Connection->new;
22
23 # Create a floating window which is smaller than the minimum enforced size of i3
24 my $window = $x->root->create_child(
25     class => WINDOW_CLASS_INPUT_OUTPUT,
26     rect => [ 0, 0, 30, 30],
27     background_color => '#C0C0C0',
28     # replace the type with 'utility' as soon as the coercion works again in X11::XCB
29     window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_UTILITY'),
30 );
31
32 isa_ok($window, 'X11::XCB::Window');
33
34 $window->map;
35
36 sleep 0.25;
37
38 ok($window->mapped, 'Window is mapped');
39
40 # switch to a different workspace, see if the window is still mapped?
41
42 my $otmp = fresh_workspace;
43
44 sleep 0.25;
45
46 ok(!$window->mapped, 'Window is not mapped after switching ws');
47
48 cmd "nop testcase done";
49
50 done_testing;