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