Skip to content

Commit

Permalink
options: allow use of the max-brightness option for the egl backend
Browse files Browse the repository at this point in the history
and notify a user better if it's not available
  • Loading branch information
absolutelynothelix committed Jan 24, 2023
1 parent 364463f commit a089481
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -812,15 +812,14 @@ bool get_cfg(options_t *opt, int argc, char *const *argv, bool shadow_enable,

opt->max_brightness = normalize_d(opt->max_brightness);
if (opt->max_brightness < 1.0) {
if (opt->use_damage) {
log_warn("--max-brightness requires --no-use-damage. Falling "
"back to 1.0");
if (opt->backend == BKEND_XRENDER || opt->legacy_backends) {
log_warn("--max-brightness is not supported by the %s backend. "
"Falling back to 1.0.",
opt->backend == BKEND_XRENDER ? "xrender" : "legacy glx");
opt->max_brightness = 1.0;
}

if (opt->legacy_backends || opt->backend != BKEND_GLX) {
log_warn("--max-brightness requires the new glx "
"backend. Falling back to 1.0");
} else if (opt->use_damage) {
log_warn("--max-brightness requires --no-use-damage. Falling "
"back to 1.0.");
opt->max_brightness = 1.0;
}
}
Expand Down

0 comments on commit a089481

Please sign in to comment.