From 6137212bce120c9eb5555ae777fc7fea2f71e43e Mon Sep 17 00:00:00 2001 From: ZenWalker Date: Tue, 8 Aug 2017 20:47:05 +0200 Subject: avoid deprecated gdk_screen_get_width/height --- libmate-desktop/mate-bg.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'libmate-desktop/mate-bg.c') diff --git a/libmate-desktop/mate-bg.c b/libmate-desktop/mate-bg.c index 36198f9..fa38a99 100644 --- a/libmate-desktop/mate-bg.c +++ b/libmate-desktop/mate-bg.c @@ -1463,8 +1463,8 @@ mate_bg_get_surface_from_root (GdkScreen *screen) gdk_error_trap_pop_ignored (); } - width = gdk_screen_get_width (screen); - height = gdk_screen_get_height (screen); + gdk_window_get_geometry (gdk_screen_get_root_window (screen), NULL, NULL, + &width, &height); if (source_pixmap) { surface = cairo_surface_create_similar (source_pixmap, @@ -2109,10 +2109,14 @@ scale_thumbnail (MateBGPlacement placement, if (get_thumb_annotations (thumb, &o_width, &o_height) || (filename && get_original_size (filename, &o_width, &o_height))) { - int scr_height = gdk_screen_get_height (screen); - int scr_width = gdk_screen_get_width (screen); + int scr_height; + int scr_width; int thumb_width = gdk_pixbuf_get_width (thumb); int thumb_height = gdk_pixbuf_get_height (thumb); + + gdk_window_get_geometry (gdk_screen_get_root_window (screen), NULL, NULL, + &scr_width, &scr_height); + double screen_to_dest = fit_factor (scr_width, scr_height, dest_width, dest_height); double thumb_to_orig = fit_factor (thumb_width, thumb_height, -- cgit v1.2.1