Dominique Leuenberger 2019-05-10 10:22:32 +00:00 committed by Git OBS Bridge
parent 863882b0c2
commit c4aa20ba6e
3 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,42 @@
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(-)
diff --git a/plugins/xsettings/gsd-xsettings-manager.c b/plugins/xsettings/gsd-xsettings-manager.c
index 3b1ebc3a..c3ac7892 100644
--- a/plugins/xsettings/gsd-xsettings-manager.c
+++ b/plugins/xsettings/gsd-xsettings-manager.c
@@ -814,8 +814,8 @@ xft_settings_set_xresources (GsdXftSettings *settings)
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",
--
2.21.0

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Sun Apr 28 01:15:09 UTC 2019 - Yifan Jiang <yfjiang@suse.com>
- Add gnome-settings-daemon-round-xft_dpi-to-integer.patch: Round
the Xft.dpi setting to an integer (bsc#1086789,
glgo#GNOME#gnome-settings-daemon!99).
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Mar 20 02:43:38 UTC 2019 - xwang@suse.com Wed Mar 20 02:43:38 UTC 2019 - xwang@suse.com

View File

@ -42,6 +42,8 @@ Patch1: gnome-settings-daemon-initial-keyboard.patch
Patch2: gnome-settings-daemon-switch-Japanese-default-input-to-mozc.patch Patch2: gnome-settings-daemon-switch-Japanese-default-input-to-mozc.patch
# PATCH-FIX-UPSTREAM gnome-settings-daemon-bgo793253.patch bgo#793253 dimstar@opensuse.org -- Fix no-return-in-nonvoid-function # PATCH-FIX-UPSTREAM gnome-settings-daemon-bgo793253.patch bgo#793253 dimstar@opensuse.org -- Fix no-return-in-nonvoid-function
Patch3: gnome-settings-daemon-bgo793253.patch Patch3: gnome-settings-daemon-bgo793253.patch
# PATCH-FIX-UPSTREAM gnome-settings-daemon-round-xft_dpi-to-integer.patch bsc#1086789 glgo#GNOME#gnome-settings-daemon!99 yfjiang@suse.com -- Round the Xft.dpi setting to an integer
Patch4: gnome-settings-daemon-round-xft_dpi-to-integer.patch
## SLE-only patches start at 1000 ## SLE-only patches start at 1000
# PATCH-FEATURE-SLE gnome-settings-daemon-notify-idle-resumed.patch bnc#439018 bnc#708182 bgo#575467 hpj@suse.com -- notify user about auto suspend when returning from sleep # PATCH-FEATURE-SLE gnome-settings-daemon-notify-idle-resumed.patch bnc#439018 bnc#708182 bgo#575467 hpj@suse.com -- notify user about auto suspend when returning from sleep
@ -149,6 +151,7 @@ gnome-patch-translation-prepare po %{name}
%patch1 -p1 %patch1 -p1
%patch2 -p1 %patch2 -p1
%patch3 -p1 %patch3 -p1
%patch4 -p1
# SLE-only patches start at 1000 # SLE-only patches start at 1000
%if !0%{?is_opensuse} %if !0%{?is_opensuse}
%patch1000 -p1 %patch1000 -p1