From ed6b368baa4ec644a9808a4204b248f5ec506cd4 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Sat, 11 May 2024 17:54:15 +0100 Subject: [PATCH] options: disable animations on legacy backends Signed-off-by: Yuxuan Shui --- src/options.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/options.c b/src/options.c index 7043a9f3..a70523f5 100644 --- a/src/options.c +++ b/src/options.c @@ -883,6 +883,20 @@ bool get_cfg(options_t *opt, int argc, char *const *argv) { check_end:; } + if (opt->legacy_backends && opt->number_of_scripts > 0) { + log_warn("Custom animations are not supported by the legacy " + "backends. Disabling animations."); + for (size_t i = 0; i < ARR_SIZE(opt->animations); i++) { + opt->animations[i].script = NULL; + } + for (int i = 0; i < opt->number_of_scripts; i++) { + script_free(opt->all_scripts[i]); + } + free(opt->all_scripts); + opt->all_scripts = NULL; + opt->number_of_scripts = 0; + } + generate_fading_config(opt); return true; }