summaryrefslogtreecommitdiff
path: root/libmate-desktop/mate-bg.c
diff options
context:
space:
mode:
authorZenWalker <[email protected]>2017-08-08 20:47:05 +0200
committerraveit65 <[email protected]>2017-08-16 22:20:50 +0200
commit6137212bce120c9eb5555ae777fc7fea2f71e43e (patch)
tree0642e60e10f8583cbe7e4880d31ec5f0a279f1df /libmate-desktop/mate-bg.c
parent0e2e562d78ead7e685e6a01749571ee5234fbf2c (diff)
downloadmate-desktop-6137212bce120c9eb5555ae777fc7fea2f71e43e.tar.bz2
mate-desktop-6137212bce120c9eb5555ae777fc7fea2f71e43e.tar.xz
avoid deprecated gdk_screen_get_width/height
Diffstat (limited to 'libmate-desktop/mate-bg.c')
-rw-r--r--libmate-desktop/mate-bg.c12
1 files changed, 8 insertions, 4 deletions
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,