From 4d724047ef0e8ce713e9d4d51773a3af4146b3a3 Mon Sep 17 00:00:00 2001 From: Maxim Solovyov Date: Fri, 16 Jun 2023 17:57:59 +0300 Subject: [PATCH 1/2] options: handle max-brightness option better allow it's use with the egl backend and report it's unavailability better --- src/options.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/options.c b/src/options.c index 1fe955ad..2ee504e9 100644 --- a/src/options.c +++ b/src/options.c @@ -824,18 +824,16 @@ bool get_cfg(options_t *opt, int argc, char *const *argv, bool shadow_enable, opt->inactive_dim = normalize_d(opt->inactive_dim); opt->frame_opacity = normalize_d(opt->frame_opacity); opt->shadow_opacity = normalize_d(opt->shadow_opacity); - 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; } } From 9f9cff3b0669b4dad7050e928b9bf8789c2252a0 Mon Sep 17 00:00:00 2001 From: Maxim Solovyov Date: Fri, 16 Jun 2023 18:21:34 +0300 Subject: [PATCH 2/2] options: unify unavailability reporting of some options unify unavailability reporting of the max-brightness, window-shader-fg and window-shader-fg-rule options --- src/options.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/options.c b/src/options.c index 2ee504e9..2b0bb177 100644 --- a/src/options.c +++ b/src/options.c @@ -805,10 +805,10 @@ bool get_cfg(options_t *opt, int argc, char *const *argv, bool shadow_enable, if (opt->window_shader_fg || opt->window_shader_fg_rules) { if (opt->backend == BKEND_XRENDER || opt->legacy_backends) { log_warn(opt->backend == BKEND_XRENDER - ? "Shader interface is not available for the " - "xrender backend." - : "The new shader interface is not available for " - "the legacy glx backend. You may want to use " + ? "Shader interface is not supported by the xrender " + "backend." + : "The new shader interface is not supported by the " + "legacy glx backend. You may want to use " "--glx-fshader-win instead."); opt->window_shader_fg = NULL; c2_list_free(&opt->window_shader_fg_rules, free);