Dominique Leuenberger
2db480b597
OBS-URL: https://build.opensuse.org/request/show/720730 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/gnome-settings-daemon?expand=0&rev=347
40 lines
1.9 KiB
Diff
40 lines
1.9 KiB
Diff
From 8d889e9545665054e4054ab21467b80e51fe1b49 Mon Sep 17 00:00:00 2001
|
|
From: Yifan J <yfjiang@suse.com>
|
|
Date: Thu, 25 Apr 2019 16:09:04 +0800
|
|
Subject: [PATCH] xsettings: Round the Xft.dpi setting to an integer
|
|
|
|
When using gnome-tweaks to set a text scale factor that is not a
|
|
multiple of 0.25 (e.g. 1.1), Xft.dpi would be calculated as a
|
|
floating point number, which breaks the fdo spec:
|
|
|
|
https://www.freedesktop.org/wiki/Specifications/XSettingsRegistry/
|
|
|
|
Although GNOME could handle the floating point Xft.dpi, graphical
|
|
programs restrictively followed the above-mentioned spec would be
|
|
influenced negatively. For example, QT applications (running on
|
|
GNOME desktop) may ignore text scaling factor when Xft.dpi was
|
|
calculated as a floating point number:
|
|
|
|
https://bugreports.qt.io/browse/QTBUG-64738
|
|
|
|
The patch at the same time has few impact to GNOME itself.
|
|
---
|
|
plugins/xsettings/gsd-xsettings-manager.c | 4 ++--
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
Index: gnome-settings-daemon-3.32.1/plugins/xsettings/gsd-xsettings-manager.c
|
|
===================================================================
|
|
--- gnome-settings-daemon-3.32.1.orig/plugins/xsettings/gsd-xsettings-manager.c
|
|
+++ gnome-settings-daemon-3.32.1/plugins/xsettings/gsd-xsettings-manager.c
|
|
@@ -814,8 +814,8 @@ xft_settings_set_xresources (GnomeXftSet
|
|
|
|
g_debug("xft_settings_set_xresources: orig res '%s'", add_string->str);
|
|
|
|
- update_property (add_string, "Xft.dpi",
|
|
- g_ascii_dtostr (dpibuf, sizeof (dpibuf), (double) settings->scaled_dpi / 1024.0));
|
|
+ g_snprintf (dpibuf, sizeof (dpibuf), "%d", (int) (settings->scaled_dpi / 1024.0 + 0.5));
|
|
+ update_property (add_string, "Xft.dpi", dpibuf);
|
|
update_property (add_string, "Xft.antialias",
|
|
settings->antialias ? "1" : "0");
|
|
update_property (add_string, "Xft.hinting",
|