summaryrefslogtreecommitdiff
path: root/libmate-desktop/mate-bg.c
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2017-12-17 01:11:18 +0100
committerPablo Barciela <[email protected]>2017-12-17 01:20:16 +0100
commitd894ddd17e0e46a5cb27a5f851c89f1829cb844a (patch)
tree3ac9f9cc069251fcc8622c10cf7294af30d75c42 /libmate-desktop/mate-bg.c
parent8e7f0805d5b63e562302ddb7dc9a87a2e9f00ba7 (diff)
downloadmate-desktop-d894ddd17e0e46a5cb27a5f851c89f1829cb844a.tar.bz2
mate-desktop-d894ddd17e0e46a5cb27a5f851c89f1829cb844a.tar.xz
WidthOfScreen and HeightOfScreen implementation
This commit reverts: https://github.com/mate-desktop/mate-desktop/commit/6137212bce120c9eb5555ae777fc7fea2f71e43e And it applies an alternative to fix the deprecated functions: gdk_screen_get_width gdk_screen_get_height
Diffstat (limited to 'libmate-desktop/mate-bg.c')
-rw-r--r--libmate-desktop/mate-bg.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/libmate-desktop/mate-bg.c b/libmate-desktop/mate-bg.c
index 9e67e0e..d4a9a71 100644
--- a/libmate-desktop/mate-bg.c
+++ b/libmate-desktop/mate-bg.c
@@ -1471,8 +1471,8 @@ mate_bg_get_surface_from_root (GdkScreen *screen)
gdk_error_trap_pop_ignored ();
}
- gdk_window_get_geometry (gdk_screen_get_root_window (screen), NULL, NULL,
- &width, &height);
+ width = WidthOfScreen (gdk_x11_screen_get_xscreen (screen));
+ height = HeightOfScreen (gdk_x11_screen_get_xscreen (screen));
if (source_pixmap) {
surface = cairo_surface_create_similar (source_pixmap,
@@ -2117,14 +2117,10 @@ 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;
- int scr_width;
+ int scr_height = HeightOfScreen (gdk_x11_screen_get_xscreen (screen));
+ int scr_width = WidthOfScreen (gdk_x11_screen_get_xscreen (screen));
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,