From 7dd843fe4fb72c327d3a85f3b4e1659aedb2382e Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Sun, 10 Nov 2019 03:00:17 +0000 Subject: [PATCH] options: max-brightness only works on the new glx backend Print warning when the requirements aren't met. Signed-off-by: Yuxuan Shui --- src/options.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/options.c b/src/options.c index 79143bd8..9161e5c0 100644 --- a/src/options.c +++ b/src/options.c @@ -834,9 +834,18 @@ 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->max_brightness = normalize_d(opt->max_brightness); - if (opt->max_brightness < 1.0 && opt->use_damage) { - log_warn("--max-brightness requires --no-use-damage. Falling back to 1.0"); - opt->max_brightness = 1.0; + if (opt->max_brightness < 1.0) { + if (opt->use_damage) { + log_warn("--max-brightness requires --no-use-damage. Falling " + "back to 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