diff options
author | ZenWalker <[email protected]> | 2017-08-08 02:14:01 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2017-08-14 08:03:54 +0200 |
commit | 7f887e614812ccb86f5d784e2db58bede8daa712 (patch) | |
tree | 860298892997172e8a6711f33268b194881f1c17 /plugins/a11y-keyboard | |
parent | daa0acc2088b8501c3c55134f8f21f3e853ca83d (diff) | |
download | mate-settings-daemon-7f887e614812ccb86f5d784e2db58bede8daa712.tar.bz2 mate-settings-daemon-7f887e614812ccb86f5d784e2db58bede8daa712.tar.xz |
avoid deprecated gdk_screen_get_width/height
Diffstat (limited to 'plugins/a11y-keyboard')
-rw-r--r-- | plugins/a11y-keyboard/msd-a11y-preferences-dialog.c | 12 |
1 files changed, 8 insertions, 4 deletions
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 |