Skip to content

Commit

Permalink
options: disable animations on legacy backends
Browse files Browse the repository at this point in the history
Signed-off-by: Yuxuan Shui <[email protected]>
  • Loading branch information
yshui committed May 12, 2024
1 parent 90e2145 commit 2dcc5df
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 "

Check warning on line 887 in src/options.c

View check run for this annotation

Codecov / codecov/patch

src/options.c#L887

Added line #L887 was not covered by tests
"backends. Disabling animations.");
for (size_t i = 0; i < ARR_SIZE(opt->animations); i++) {
opt->animations[i].script = NULL;

Check warning on line 890 in src/options.c

View check run for this annotation

Codecov / codecov/patch

src/options.c#L889-L890

Added lines #L889 - L890 were not covered by tests
}
for (int i = 0; i < opt->number_of_scripts; i++) {
script_free(opt->all_scripts[i]);

Check warning on line 893 in src/options.c

View check run for this annotation

Codecov / codecov/patch

src/options.c#L892-L893

Added lines #L892 - L893 were not covered by tests
}
free(opt->all_scripts);
opt->all_scripts = NULL;
opt->number_of_scripts = 0;

Check warning on line 897 in src/options.c

View check run for this annotation

Codecov / codecov/patch

src/options.c#L895-L897

Added lines #L895 - L897 were not covered by tests
}

generate_fading_config(opt);
return true;
}
Expand Down

0 comments on commit 2dcc5df

Please sign in to comment.