]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix DPI calculation when Xft/DPI is default
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 10 Aug 2015 06:23:14 +0000 (23:23 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 10 Aug 2015 06:23:38 +0000 (23:23 -0700)
* 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

index 028487b91ee1a10305aab89f60dfbf8a9b01db59..f6a8bfdebd9c21d22ff299abf102c503e652cbf0 100644 (file)
@@ -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)
             {