From a9bb9d8fc22417d1fafd8001d89a91c33c8b39ec Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 9 Aug 2015 23:23:14 -0700 Subject: [PATCH] Fix DPI calculation when Xft/DPI is default * src/xsettings.c (parse_settings): Don't use Xft/DPI default value of -1, which evaluates to 2**32 - 1 (Bug#21152). Remove unnecessary cast while we're in the neighborhood. --- src/xsettings.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xsettings.c b/src/xsettings.c index 028487b91ee..f6a8bfdebd9 100644 --- a/src/xsettings.c +++ b/src/xsettings.c @@ -537,10 +537,10 @@ parse_settings (unsigned char *prop, else settings->seen &= ~SEEN_RGBA; } - else if (strcmp (name, "Xft/DPI") == 0) + else if (strcmp (name, "Xft/DPI") == 0 && ival != (CARD32) -1) { settings->seen |= SEEN_DPI; - settings->dpi = (double)ival/1024.0; + settings->dpi = ival / 1024.0; } else if (strcmp (name, "Xft/lcdfilter") == 0) { -- 2.39.2