options: disable animations on legacy backends

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2024-05-11 17:54:15 +01:00
parent dda95382b5
commit ed6b368baa
No known key found for this signature in database
GPG Key ID: D3A4405BE6CC17F4
1 changed files with 14 additions and 0 deletions

View File

@ -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;
}