Skip to content

Commit f4b24d3

Browse files
committed
options: disable animations on legacy backends
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
1 parent 9c8e6d1 commit f4b24d3

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/options.c

+14
Original file line numberDiff line numberDiff line change
@@ -883,6 +883,20 @@ bool get_cfg(options_t *opt, int argc, char *const *argv) {
883883
check_end:;
884884
}
885885

886+
if (opt->legacy_backends && opt->number_of_scripts > 0) {
887+
log_warn("Custom animations are not supported by the legacy "
888+
"backends. Disabling animations.");
889+
for (size_t i = 0; i < ARR_SIZE(opt->animations); i++) {
890+
opt->animations[i].script = NULL;
891+
}
892+
for (int i = 0; i < opt->number_of_scripts; i++) {
893+
script_free(opt->all_scripts[i]);
894+
}
895+
free(opt->all_scripts);
896+
opt->all_scripts = NULL;
897+
opt->number_of_scripts = 0;
898+
}
899+
886900
generate_fading_config(opt);
887901
return true;
888902
}

0 commit comments

Comments
 (0)