summaryrefslogtreecommitdiff
path: root/src/config.c
diff options
context:
space:
mode:
authorPhil Jones <philj56@gmail.com>2022-10-18 22:27:50 +0100
committerPhil Jones <philj56@gmail.com>2022-10-18 22:27:50 +0100
commit7bb70c7407f652c584837d651fb9bcdb6b66ff9f (patch)
treefc6e368d7bd2efe0bea3efa88ff0e42577ce1f98 /src/config.c
parent340692299ed834f962b83b1bc0eb6f49471ca556 (diff)
Fix --exclusive-zone=-1 not working.
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c59
1 files changed, 31 insertions, 28 deletions
diff --git a/src/config.c b/src/config.c
index a1bfb7a..915e548 100644
--- a/src/config.c
+++ b/src/config.c
@@ -542,34 +542,37 @@ void config_fixup_values(struct tofi *tofi)
tofi->window.scale,
tofi->use_scale);
- /* Exclusive zone base depends on anchor. */
- switch (tofi->anchor) {
- case ANCHOR_TOP:
- case ANCHOR_BOTTOM:
- tofi->window.exclusive_zone = fixup_percentage(
- tofi->window.exclusive_zone,
- tofi->output_height,
- tofi->window.exclusive_zone_is_percent,
- tofi->window.scale,
- tofi->use_scale);
- break;
- case ANCHOR_LEFT:
- case ANCHOR_RIGHT:
- tofi->window.exclusive_zone = fixup_percentage(
- tofi->window.exclusive_zone,
- tofi->output_width,
- tofi->window.exclusive_zone_is_percent,
- tofi->window.scale,
- tofi->use_scale);
- break;
- default:
- /*
- * Exclusive zone >0 is meaningless for other anchor
- * positions.
- */
- tofi->window.exclusive_zone =
- MIN(tofi->window.exclusive_zone, 0);
- break;
+ /* Don't attempt percentage handling if exclusive_zone is set to -1. */
+ if (tofi->window.exclusive_zone > 0) {
+ /* Exclusive zone base depends on anchor. */
+ switch (tofi->anchor) {
+ case ANCHOR_TOP:
+ case ANCHOR_BOTTOM:
+ tofi->window.exclusive_zone = fixup_percentage(
+ tofi->window.exclusive_zone,
+ tofi->output_height,
+ tofi->window.exclusive_zone_is_percent,
+ tofi->window.scale,
+ tofi->use_scale);
+ break;
+ case ANCHOR_LEFT:
+ case ANCHOR_RIGHT:
+ tofi->window.exclusive_zone = fixup_percentage(
+ tofi->window.exclusive_zone,
+ tofi->output_width,
+ tofi->window.exclusive_zone_is_percent,
+ tofi->window.scale,
+ tofi->use_scale);
+ break;
+ default:
+ /*
+ * Exclusive zone >0 is meaningless for other anchor
+ * positions.
+ */
+ tofi->window.exclusive_zone =
+ MIN(tofi->window.exclusive_zone, 0);
+ break;
+ }
}
}