]> git.sur5r.net Git - i3/i3/blob - testcases/t/526-reconfigure-dock.t
Merge branch 'next' into master
[i3/i3] / testcases / t / 526-reconfigure-dock.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 # Test reconfiguration of dock clients.
18 # Ticket: #1883
19 use i3test i3_autostart => 0;
20
21 my ($config, $pid, $window, $rect);
22 my (@docks);
23
24 ###############################################################################
25 # 1: Given two screens A and B and a dock client on screen A, when the dock
26 #    client is reconfigured to be positioned on screen B, then the client is
27 #    moved to the correct position.
28 ###############################################################################
29
30 $config = <<EOT;
31 # i3 config file (v4)
32 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
33
34 fake-outputs 1024x768+0+0,1024x768+1024+0
35 EOT
36 $pid = launch_with_config($config);
37
38 $window = open_window({
39         window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_DOCK')
40     });
41
42 $rect = $window->rect;
43 is($rect->x, 0, 'sanity check: dock client is on the left screen');
44
45 $window->rect(X11::XCB::Rect->new(x => 1024, y => 0, width => 1024, height => 30));
46 sync_with_i3;
47
48 @docks = get_dock_clients;
49 is(@docks, 1, 'there is still exactly one dock');
50
51 is($docks[0]->{rect}->{x}, 1024, 'dock client has moved to the other screen');
52
53 exit_gracefully($pid);
54
55 ###############################################################################
56
57 done_testing;