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 11, 2024
1 parent f1d1979 commit 98f0d48
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 @@ -894,6 +894,20 @@ bool get_cfg(options_t *opt, int argc, char *const *argv, bool shadow_enable,
"properly under X Render backend.");
}

if (opt->legacy_backends && opt->number_of_scripts > 0) {
log_warn("Animations are not supported by the legacy "

Check warning on line 898 in src/options.c

View check run for this annotation

Codecov / codecov/patch

src/options.c#L898

Added line #L898 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 901 in src/options.c

View check run for this annotation

Codecov / codecov/patch

src/options.c#L900-L901

Added lines #L900 - L901 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 904 in src/options.c

View check run for this annotation

Codecov / codecov/patch

src/options.c#L903-L904

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

Check warning on line 908 in src/options.c

View check run for this annotation

Codecov / codecov/patch

src/options.c#L906-L908

Added lines #L906 - L908 were not covered by tests
}

generate_fading_config(opt);
return true;
}
Expand Down

0 comments on commit 98f0d48

Please sign in to comment.