From: Paul Eggert Date: Mon, 10 Aug 2015 06:23:14 +0000 (-0700) Subject: Fix DPI calculation when Xft/DPI is default X-Git-Tag: emacs-25.0.90~1373^2~70 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a9bb9d8fc22417d1fafd8001d89a91c33c8b39ec;p=emacs.git 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. --- 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) {