1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
#!perl
# vim:ts=4:sw=4:expandtab
#
# Please read the following documents before working on tests:
# • https://build.i3wm.org/docs/testsuite.html
# (or docs/testsuite)
#
# • https://build.i3wm.org/docs/lib-i3test.html
# (alternatively: perldoc ./testcases/lib/i3test.pm)
#
# • https://build.i3wm.org/docs/ipc.html
# (or docs/ipc)
#
# • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
# (unless you are already familiar with Perl)
#
# Regression test: Changing border style should not have an impact on the size
# (geometry) of the child window. See ticket https://bugs.i3wm.org/561
# Wrong behaviour manifested itself up to (including) commit
# d805d1bbeaf89e11f67c981f94c9f55bbb4b89d9
#
use i3test;
my $tmp = fresh_workspace;
my $win = open_floating_window(rect => [10, 10, 200, 100]);
my $geometry = $win->rect;
is($geometry->{width}, 200, 'width correct');
is($geometry->{height}, 100, 'height correct');
cmd 'border 1pixel';
$geometry = $win->rect;
is($geometry->{width}, 200, 'width correct');
is($geometry->{height}, 100, 'height correct');
################################################################################
# When in fullscreen mode, the original position must not be overwritten.
################################################################################
sub get_floating_con_rect {
my ($nodes, $focus) = get_ws($tmp);
my $floating_con = $nodes->{floating_nodes}->[0];
return $floating_con->{rect};
}
my $old_rect = get_floating_con_rect();
cmd 'fullscreen';
is_deeply(get_floating_con_rect(), $old_rect, 'Rect the same after going into fullscreen');
cmd 'border pixel 2';
is_deeply(get_floating_con_rect(), $old_rect, 'Rect the same after changing border style');
done_testing;
|