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 # Verifies that 'move position center' moves floating cons to the center of
18 # the appropriate output.
20 # Bug still in: 4.9.1-108-g037cb31
21 use i3test i3_autostart => 0;
25 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
27 fake-outputs 1024x768+0+0,1024x768+1024+0
29 workspace left output fake-0
30 workspace right output fake-1
33 my $pid = launch_with_config($config);
35 #####################################################################
36 # Verify that 'move position center' on a floating window does not
37 # move it to another output.
38 #####################################################################
42 # Sync in case focus switched outputs due to the workspace change.
45 my $floating = open_floating_window;
47 # Center the window on the left workspace
48 cmd 'move position center';
51 is(scalar @{get_ws('left')->{floating_nodes}}, 1, 'one floating node on left ws');
52 is(scalar @{get_ws('right')->{floating_nodes}}, 0, 'no floating nodes on right ws');
54 # Center the window on the right workspace
55 cmd 'move workspace right; workspace right; move position center';
58 is(scalar @{get_ws('left')->{floating_nodes}}, 0, 'no floating nodes on left ws');
59 is(scalar @{get_ws('right')->{floating_nodes}}, 1, 'one floating node on right ws');
61 exit_gracefully($pid);