2 # vim:ts=4:sw=4:expandtab
4 # Please read the following documents before working on tests:
5 # • http://build.i3wm.org/docs/testsuite.html
8 # • http://build.i3wm.org/docs/lib-i3test.html
9 # (alternatively: perldoc ./testcases/lib/i3test.pm)
11 # • http://build.i3wm.org/docs/ipc.html
14 # • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
15 # (unless you are already familiar with Perl)
17 # Test reconfiguration of dock clients.
19 use i3test i3_autostart => 0;
21 my ($config, $pid, $window, $rect);
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 ###############################################################################
32 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
34 fake-outputs 1024x768+0+0,1024x768+1024+0
36 $pid = launch_with_config($config);
38 $window = open_window({
39 window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_DOCK')
42 $rect = $window->rect;
43 is($rect->x, 0, 'sanity check: dock client is on the left screen');
45 $window->rect(X11::XCB::Rect->new(x => 1024, y => 0, width => 1024, height => 30));
48 @docks = get_dock_clients;
49 is(@docks, 1, 'there is still exactly one dock');
51 is($docks[0]->{rect}->{x}, 1024, 'dock client has moved to the other screen');
53 exit_gracefully($pid);
55 ###############################################################################