From 264df67a63111ed3744581d0acea937c88b0916b Mon Sep 17 00:00:00 2001 From: Nikos Tsipinakis Date: Thu, 2 May 2019 12:31:24 +0300 Subject: [PATCH] Fix negative width being ignored In `x_parse_geometry` we modified the global settings struct for negative width instead of updating it in the struct that is currently being constructed. As a result the negative_width field was always false as it was being overwritten by the struct assignment after the functions return. Fixes #628 --- src/x11/x.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/x11/x.c b/src/x11/x.c index 55267e8..e5f8177 100644 --- a/src/x11/x.c +++ b/src/x11/x.c @@ -531,16 +531,15 @@ void x_setup(void) struct geometry x_parse_geometry(const char *geom_str) { assert(geom_str); + struct geometry geometry = { 0 }; if (geom_str[0] == '-') { - settings.geometry.negative_width = true; + geometry.negative_width = true; geom_str++; } else { - settings.geometry.negative_width = false; + geometry.negative_width = false; } - struct geometry geometry = { 0 }; - int mask = XParseGeometry(geom_str, &geometry.x, &geometry.y, &geometry.w, &geometry.h);