diff options
author | ZenWalker <[email protected]> | 2017-08-06 02:01:47 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2017-08-15 17:20:58 +0200 |
commit | 061f3780a3af6224a804d239f9b9dfc5c81873f6 (patch) | |
tree | 6bd01d58e8dcce0c51e015b1a441c25b9c5a6d9e /capplets | |
parent | 930a86b399d43ab779d8b70e43e31e4ef453fb8e (diff) | |
download | mate-control-center-061f3780a3af6224a804d239f9b9dfc5c81873f6.tar.bz2 mate-control-center-061f3780a3af6224a804d239f9b9dfc5c81873f6.tar.xz |
avoid deprecated gdk_screen_get_width/height
Diffstat (limited to 'capplets')
-rw-r--r-- | capplets/appearance/appearance-font.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/capplets/appearance/appearance-font.c b/capplets/appearance/appearance-font.c index af2a1a41..f47504f3 100644 --- a/capplets/appearance/appearance-font.c +++ b/capplets/appearance/appearance-font.c @@ -425,11 +425,13 @@ get_dpi_from_x_server (void) screen = gdk_screen_get_default (); if (screen) { 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) |