1
0
Fork 0
mirror of https://github.com/yshui/picom.git synced 2024-11-11 13:51:02 -05:00

options: max-brightness only works on the new glx backend

Print warning when the requirements aren't met.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2019-11-10 03:00:17 +00:00
parent f6a51be234
commit 7dd843fe4f
No known key found for this signature in database
GPG key ID: 37C999F617EA1A47

View file

@ -834,11 +834,20 @@ void get_cfg(options_t *opt, int argc, char *const *argv, bool shadow_enable,
opt->refresh_rate = normalize_i_range(opt->refresh_rate, 0, 300); opt->refresh_rate = normalize_i_range(opt->refresh_rate, 0, 300);
opt->max_brightness = normalize_d(opt->max_brightness); opt->max_brightness = normalize_d(opt->max_brightness);
if (opt->max_brightness < 1.0 && opt->use_damage) { if (opt->max_brightness < 1.0) {
log_warn("--max-brightness requires --no-use-damage. Falling back to 1.0"); if (opt->use_damage) {
log_warn("--max-brightness requires --no-use-damage. Falling "
"back to 1.0");
opt->max_brightness = 1.0; opt->max_brightness = 1.0;
} }
if (!opt->experimental_backends || opt->backend != BKEND_GLX) {
log_warn("--max-brightness requires the experimental glx "
"backend. Falling back to 1.0");
opt->max_brightness = 1.0;
}
}
// Apply default wintype options that are dependent on global options // Apply default wintype options that are dependent on global options
set_default_winopts(opt, winopt_mask, shadow_enable, fading_enable); set_default_winopts(opt, winopt_mask, shadow_enable, fading_enable);