]> git.sur5r.net Git - i3/i3/blob - testcases/t/230-floating-fullscreen-restart.t
Bugfix: don’t overwrite the window’s geometry after restarting
[i3/i3] / testcases / t / 230-floating-fullscreen-restart.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 # Ensures floating windows don’t drop out of fullscreen mode when restarting
18 # and that they keep their geometry.
19 # Ticket: #1263
20 # Bug still in: 4.7.2-200-g570b572
21 use i3test i3_autostart => 0;
22
23 my $config = <<EOT;
24 # i3 config file (v4)
25 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
26
27 for_window [instance=__i3-test-window] floating enable, border pixel 1
28 EOT
29
30 my $pid = launch_with_config($config);
31 my $tmp = fresh_workspace;
32
33 my $window = open_window(wm_class => '__i3-test-window');
34
35 cmd 'fullscreen';
36
37 my ($nodes, $focus) = get_ws($tmp);
38 my $floating_win = $nodes->{floating_nodes}->[0]->{nodes}->[0];
39 is($floating_win->{fullscreen_mode}, 1, 'floating window in fullscreen mode');
40 my $old_geometry = $floating_win->{geometry};
41
42 cmd 'restart';
43
44 ($nodes, $focus) = get_ws($tmp);
45 $floating_win = $nodes->{floating_nodes}->[0]->{nodes}->[0];
46 is($floating_win->{fullscreen_mode}, 1, 'floating window still in fullscreen mode');
47 is_deeply($floating_win->{geometry}, $old_geometry, 'floating window geometry still the same');
48
49 exit_gracefully($pid);
50
51 done_testing;