From f8424646a530422be4fe80ad6b73b11448a856cb Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Mon, 24 Jan 2022 18:12:31 +0000 Subject: [PATCH] Remove the glx-swap-method option Deprecated since v6. Signed-off-by: Yuxuan Shui --- src/config_libconfig.c | 12 +++++++----- src/options.c | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/config_libconfig.c b/src/config_libconfig.c index e3004cb8..79a8132f 100644 --- a/src/config_libconfig.c +++ b/src/config_libconfig.c @@ -580,6 +580,7 @@ char *parse_config_libconfig(options_t *opt, const char *config_file, bool *shad if (config_lookup_string(&cfg, "glx-swap-method", &sval)) { char *endptr; long val = strtol(sval, &endptr, 10); + bool should_remove = true; if (*endptr || !(*sval)) { // sval is not a number, or an empty string val = -1; @@ -587,12 +588,13 @@ char *parse_config_libconfig(options_t *opt, const char *config_file, bool *shad if (strcmp(sval, "undefined") != 0 && val != 0) { // If not undefined, we will use damage and buffer-age to limit // the rendering area. - opt->use_damage = true; + should_remove = false; } - log_warn("glx-swap-method has been deprecated since v6, your setting " - "\"%s\" should be %s.", - sval, - opt->use_damage ? "replaced by `use-damage = true`" : "removed"); + log_error("glx-swap-method has been removed, your setting " + "\"%s\" should be %s.", + sval, + !should_remove ? "replaced by `use-damage = true`" : "removed"); + goto err; } // --use-damage lcfg_lookup_bool(&cfg, "use-damage", &opt->use_damage); diff --git a/src/options.c b/src/options.c index 093ce4cd..3a669499 100644 --- a/src/options.c +++ b/src/options.c @@ -766,14 +766,14 @@ bool get_cfg(options_t *opt, int argc, char *const *argv, bool shadow_enable, if (strcmp(optarg, "undefined") != 0 && tmpval != 0) { // If not undefined, we will use damage and buffer-age to // limit the rendering area. - opt->use_damage = true; should_remove = false; } - log_warn("--glx-swap-method has been deprecated, your setting " + log_error("--glx-swap-method has been removed, your setting " "\"%s\" should be %s.", optarg, !should_remove ? "replaced by `--use-damage`" : "removed"); + failed = true; break; } case 300: