]> git.sur5r.net Git - i3/i3/blob - testcases/t/231-wm-change-state.t
Merge branch 'master' into next
[i3/i3] / testcases / t / 231-wm-change-state.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3 #
4 # Please read the following documents before working on tests:
5 # • http://build.i3wm.org/docs/testsuite.html
6 #   (or docs/testsuite)
7 #
8 # • http://build.i3wm.org/docs/lib-i3test.html
9 #   (alternatively: perldoc ./testcases/lib/i3test.pm)
10 #
11 # • http://build.i3wm.org/docs/ipc.html
12 #   (or docs/ipc)
13 #
14 # • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
15 #   (unless you are already familiar with Perl)
16 #
17 # Correctly handle WM_CHANGE_STATE requests for the iconic state
18 # See http://tronche.com/gui/x/icccm/sec-4.html#s-4.1.4
19 # Ticket: #1279
20 # Bug still in: 4.8-7-gf4a8253
21 use i3test;
22
23 sub send_iconic_state_request {
24     my ($win) = @_;
25
26     my $msg = pack "CCSLLLLLL",
27         X11::XCB::CLIENT_MESSAGE, # response_type
28         32, # format
29         0, # sequence
30         $win->id, # window
31         $x->atom(name => 'WM_CHANGE_STATE')->id, # message type
32         3, # data32[0]
33         0, # data32[1]
34         0, # data32[2]
35         0, # data32[3]
36         0; # data32[4]
37
38     $x->send_event(0, $x->get_root_window(), X11::XCB::EVENT_MASK_SUBSTRUCTURE_REDIRECT, $msg);
39 }
40
41 my $ws = fresh_workspace;
42 my $win = open_window;
43
44 send_iconic_state_request($win);
45 sync_with_i3;
46
47 is(@{get_ws($ws)->{nodes}}, 0, 'When a window requests the iconic state, the container should be closed');
48
49 done_testing;