summaryrefslogtreecommitdiff
path: root/plugins/xsettings/msd-xsettings-manager.c
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2017-12-02 01:15:07 +0100
committerPablo Barciela <[email protected]>2017-12-02 15:58:23 +0100
commit788babedafaf59d8b7a36cb0ef3b0b1f0e5f732c (patch)
tree353bfe6e744432e037b1d04ad5705cb1dcb14f26 /plugins/xsettings/msd-xsettings-manager.c
parent4026dbbfc77b3d7a2769d2e3615cc259290c96f7 (diff)
downloadmate-settings-daemon-788babedafaf59d8b7a36cb0ef3b0b1f0e5f732c.tar.bz2
mate-settings-daemon-788babedafaf59d8b7a36cb0ef3b0b1f0e5f732c.tar.xz
Fix: big fonts by default with "org.mate.desktop.font-rendering.dpi"
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1517547
Diffstat (limited to 'plugins/xsettings/msd-xsettings-manager.c')
-rw-r--r--plugins/xsettings/msd-xsettings-manager.c24
1 files changed, 5 insertions, 19 deletions
diff --git a/plugins/xsettings/msd-xsettings-manager.c b/plugins/xsettings/msd-xsettings-manager.c
index a548dd4..a9635a8 100644
--- a/plugins/xsettings/msd-xsettings-manager.c
+++ b/plugins/xsettings/msd-xsettings-manager.c
@@ -237,25 +237,11 @@ get_dpi_from_x_server (void)
screen = gdk_screen_get_default ();
if (screen != NULL) {
double width_dpi, height_dpi;
- gint sc_width, sc_height;
-#if GTK_CHECK_VERSION (3, 22, 0)
- GdkDisplay *display;
- GdkMonitor *monitor;
-
- display = gdk_screen_get_display (screen);
- monitor = gdk_display_get_primary_monitor (display);
-#endif
-
- gdk_window_get_geometry (gdk_screen_get_root_window (screen), NULL, NULL,
- &sc_width, &sc_height);
-
-#if GTK_CHECK_VERSION (3, 22, 0)
- width_dpi = dpi_from_pixels_and_mm (sc_width, gdk_monitor_get_width_mm (monitor));
- height_dpi = dpi_from_pixels_and_mm (sc_height, gdk_monitor_get_height_mm (monitor));
-#else
- width_dpi = dpi_from_pixels_and_mm (sc_width, gdk_screen_get_width_mm (screen));
- height_dpi = dpi_from_pixels_and_mm (sc_height, gdk_screen_get_height_mm (screen));
-#endif
+
+ Screen *xscreen = gdk_x11_screen_get_xscreen (screen);
+
+ width_dpi = dpi_from_pixels_and_mm (WidthOfScreen (xscreen), WidthMMOfScreen (xscreen));
+ height_dpi = dpi_from_pixels_and_mm (HeightOfScreen (xscreen), HeightMMOfScreen (xscreen));
if (width_dpi < DPI_LOW_REASONABLE_VALUE || width_dpi > DPI_HIGH_REASONABLE_VALUE
|| height_dpi < DPI_LOW_REASONABLE_VALUE || height_dpi > DPI_HIGH_REASONABLE_VALUE) {