summaryrefslogtreecommitdiff
path: root/plugins/xsettings
diff options
context:
space:
mode:
authorZenWalker <[email protected]>2017-08-08 02:14:01 +0200
committerraveit65 <[email protected]>2017-08-14 08:03:54 +0200
commit7f887e614812ccb86f5d784e2db58bede8daa712 (patch)
tree860298892997172e8a6711f33268b194881f1c17 /plugins/xsettings
parentdaa0acc2088b8501c3c55134f8f21f3e853ca83d (diff)
downloadmate-settings-daemon-7f887e614812ccb86f5d784e2db58bede8daa712.tar.bz2
mate-settings-daemon-7f887e614812ccb86f5d784e2db58bede8daa712.tar.xz
avoid deprecated gdk_screen_get_width/height
Diffstat (limited to 'plugins/xsettings')
-rw-r--r--plugins/xsettings/msd-xsettings-manager.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/xsettings/msd-xsettings-manager.c b/plugins/xsettings/msd-xsettings-manager.c
index e7849ec..c3d06dd 100644
--- a/plugins/xsettings/msd-xsettings-manager.c
+++ b/plugins/xsettings/msd-xsettings-manager.c
@@ -237,9 +237,13 @@ get_dpi_from_x_server (void)
screen = gdk_screen_get_default ();
if (screen != NULL) {
double width_dpi, height_dpi;
+ gint sc_width, sc_height;
- width_dpi = dpi_from_pixels_and_mm (gdk_screen_get_width (screen), gdk_screen_get_width_mm (screen));
- height_dpi = dpi_from_pixels_and_mm (gdk_screen_get_height (screen), gdk_screen_get_height_mm (screen));
+ gdk_window_get_geometry (gdk_screen_get_root_window (screen), NULL, NULL,
+ &sc_width, &sc_height);
+
+ 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));
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) {