summaryrefslogtreecommitdiff
path: root/src/xsettings.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2015-08-09 23:23:14 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2015-08-09 23:23:38 -0700
commita9bb9d8fc22417d1fafd8001d89a91c33c8b39ec (patch)
tree6cc8920624e5f5d01f1a9d94136f129161d3f323 /src/xsettings.c
parentd39f33cf37b8c352e3ca6839eb2b8e01cb8103a8 (diff)
downloademacs-a9bb9d8fc22417d1fafd8001d89a91c33c8b39ec.tar.gz
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.
Diffstat (limited to 'src/xsettings.c')
-rw-r--r--src/xsettings.c4
1 files 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)
{