summaryrefslogtreecommitdiff
path: root/plugins/xsettings
diff options
context:
space:
mode:
authorOleksandr Chekhovskyi <[email protected]>2021-04-09 12:55:18 +0300
committerraveit65 <[email protected]>2021-04-26 07:58:04 +0200
commit3a44f06bdaaf42e103d03ffbfc96229aaec46bed (patch)
treed2eb8d18f60e6af6f20738d7922b8e9bfb92bdf0 /plugins/xsettings
parent675361bbc75a423ecf5ef646dd2ad1bbf6ecab5a (diff)
downloadmate-settings-daemon-3a44f06bdaaf42e103d03ffbfc96229aaec46bed.tar.bz2
mate-settings-daemon-3a44f06bdaaf42e103d03ffbfc96229aaec46bed.tar.xz
xsettings: Set Xft.dpi in X resources to scaled_dpi
This makes it match Xft/DPI in XSETTINGS. Applications relying on Xft.dpi on HiDPI screens will now work correctly. Behavior is now consistent with GNOME, relevant commits from gsd: https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/commit/047f030235972fdab5e15aff484006caf914216a https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/commit/25c7cc703118c69b224acf9c4f7af09a31f50a34
Diffstat (limited to 'plugins/xsettings')
-rw-r--r--plugins/xsettings/msd-xsettings-manager.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/xsettings/msd-xsettings-manager.c b/plugins/xsettings/msd-xsettings-manager.c
index 7e4f743..5247523 100644
--- a/plugins/xsettings/msd-xsettings-manager.c
+++ b/plugins/xsettings/msd-xsettings-manager.c
@@ -660,8 +660,8 @@ xft_settings_set_xresources (MateXftSettings *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->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",