From 7f887e614812ccb86f5d784e2db58bede8daa712 Mon Sep 17 00:00:00 2001 From: ZenWalker Date: Tue, 8 Aug 2017 02:14:01 +0200 Subject: avoid deprecated gdk_screen_get_width/height --- plugins/a11y-keyboard/msd-a11y-preferences-dialog.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'plugins/a11y-keyboard') diff --git a/plugins/a11y-keyboard/msd-a11y-preferences-dialog.c b/plugins/a11y-keyboard/msd-a11y-preferences-dialog.c index 410757a..92b75c3 100644 --- a/plugins/a11y-keyboard/msd-a11y-preferences-dialog.c +++ b/plugins/a11y-keyboard/msd-a11y-preferences-dialog.c @@ -177,11 +177,15 @@ get_dpi_from_x_server (void) if (screen != NULL) { double width_dpi; double height_dpi; + gint sc_width; + gint sc_height; + + 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)); - 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)); if (width_dpi < DPI_LOW_REASONABLE_VALUE || width_dpi > DPI_HIGH_REASONABLE_VALUE || height_dpi < DPI_LOW_REASONABLE_VALUE -- cgit v1.2.1