]> git.sur5r.net Git - i3/i3/blob - testcases/t/194-regress-floating-size.t
Merge branch 'master' into next
[i3/i3] / testcases / t / 194-regress-floating-size.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3 # Verifies that the size requested by floating windows is set by i3, no matter
4 # to which value the new_window option is set.
5 # ticket #770, bug still present in commit ae88accf6fe3817ff42d0d51be1965071194766e
6 use i3test i3_autostart => 0;
7
8 sub test_with_new_window_value {
9     my ($value) = @_;
10
11     my $config = <<EOT;
12 # i3 config file (v4)
13 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
14 EOT
15
16     if (defined($value)) {
17         $config .= "new_window $value\n";
18         diag("testing with new_window $value");
19     } else {
20         diag("testing without new_window");
21     }
22
23     my $pid = launch_with_config($config);
24
25     my $tmp = fresh_workspace;
26
27     my $window = open_floating_window({ rect => [ 0, 0, 400, 150 ] });
28
29     my ($absolute, $top) = $window->rect;
30
31     ok($window->mapped, 'Window is mapped');
32     cmp_ok($absolute->{width}, '==', 400, 'requested width kept');
33     cmp_ok($absolute->{height}, '==', 150, 'requested height kept');
34
35     exit_gracefully($pid);
36 }
37
38 test_with_new_window_value(undef);
39 test_with_new_window_value('1pixel');
40 test_with_new_window_value('normal');
41 test_with_new_window_value('none');
42
43 done_testing;