From 801553f1d5723a47f701439fa29278bb75cf2ed7 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Thu, 14 Nov 2024 15:25:53 +0000 Subject: [PATCH] config: fix use of the "geometry" alias in animation suppressions Signed-off-by: Yuxuan Shui --- src/config_libconfig.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/config_libconfig.c b/src/config_libconfig.c index 0356d373b5..0b4d7a7584 100644 --- a/src/config_libconfig.c +++ b/src/config_libconfig.c @@ -423,6 +423,19 @@ static bool parse_animation_one(struct win_script *animations, config_setting_remove(setting, "suppressions"); } + if ((result.suppressions & (1 << ANIMATION_TRIGGER_ALIAS_GEOMETRY)) != 0) { + const uint64_t to_set = + (1 << ANIMATION_TRIGGER_SIZE) | (1 << ANIMATION_TRIGGER_POSITION); + if ((result.suppressions & to_set) != 0) { + log_warn("Trigger \"geometry\" is an alias of \"size\" and " + "\"position\", but one or both of them are also set at " + "line %d", + config_setting_source_line(suppressions_setting)); + } + result.suppressions |= to_set; + } + result.suppressions &= (1 << ANIMATION_TRIGGER_COUNT) - 1; + char *err; if (!compile_win_script(&result, setting, &err)) { log_error("Failed to parse animation script at line %d: %s",