aboutsummaryrefslogtreecommitdiff
path: root/testcases
diff options
context:
space:
mode:
authorMichael Stapelberg <stapelberg@users.noreply.github.com>2022-11-07 19:02:57 +0100
committerGitHub <noreply@github.com>2022-11-07 19:02:57 +0100
commit804bca3a9ab4dce2c163e9c1028c34f7ff8c0bc7 (patch)
tree511939d9040c40176c8813c0a64bd572c6e002d1 /testcases
parent14795c303c09777c5037088b3813b39a0164db3c (diff)
downloadi3-804bca3a9ab4dce2c163e9c1028c34f7ff8c0bc7.tar.gz
i3-804bca3a9ab4dce2c163e9c1028c34f7ff8c0bc7.zip
gaps: make workspace gap assignments order-independent (#5259)
This commit moves subtracting the global gaps from the workspace gaps: previously, this calculation was done while parsing the configuration (order dependent), now it’s done at workspace assignment evaluation time. related to https://github.com/i3/i3/issues/3724 fixes https://github.com/i3/i3/issues/5253
Diffstat (limited to 'testcases')
-rw-r--r--testcases/t/319-gaps.t39
1 files changed, 38 insertions, 1 deletions
diff --git a/testcases/t/319-gaps.t b/testcases/t/319-gaps.t
index 66b2abee..8bb610b7 100644
--- a/testcases/t/319-gaps.t
+++ b/testcases/t/319-gaps.t
@@ -17,7 +17,9 @@
# Basic gaps functionality test
# Ticket: #3724
-use i3test i3_config => <<EOT;
+use i3test i3_autostart => 0;
+
+my $config = <<EOT;
# i3 config file (v4)
font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
@@ -27,6 +29,8 @@ gaps outer 20px
default_border pixel 0
EOT
+my $pid = launch_with_config($config);
+
my $tmp = fresh_workspace;
my $left = open_window;
@@ -126,4 +130,37 @@ $total_gaps = $outer_gaps + $inner_gaps;
sync_with_i3;
is_gaps_in_between_only();
+exit_gracefully($pid);
+
+################################################################################
+# Ensure gaps configuration does not need to be ordered from least to most specific
+################################################################################
+
+$config = <<EOT;
+# i3 config file (v4)
+font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
+
+# This should result in a gap of 16px, not 26px
+workspace 2 gaps inner 16
+gaps inner 10
+
+default_border pixel 0
+EOT
+
+$pid = launch_with_config($config);
+
+cmd 'workspace 2';
+
+$left = open_window;
+$right = open_window;
+sync_with_i3;
+
+$inner_gaps = 16;
+$outer_gaps = 0;
+$total_gaps = $outer_gaps + $inner_gaps;
+
+is_gaps();
+
+exit_gracefully($pid);
+
done_testing;