From c4911e303edd2352597ec5879df1137fd0a83274 Mon Sep 17 00:00:00 2001 From: Pablo Barciela Date: Sun, 10 Dec 2017 02:53:45 +0100 Subject: WidthOfScreen and HeightOfScreen implementation This commit reverts: https://github.com/mate-desktop/atril/commit/d9fffe2dc0e33d6777099c18635b7b75f54d3d35 And it applies an alternative to fix the deprecated functions: gdk_screen_get_width gdk_screen_get_height --- shell/ev-window.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'shell') diff --git a/shell/ev-window.c b/shell/ev-window.c index a1675fcf..9102fe2b 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -40,6 +40,7 @@ #include #include #include +#include #include "egg-editable-toolbar.h" #include "egg-toolbar-editor.h" @@ -1337,8 +1338,6 @@ setup_document_from_metadata (EvWindow *window) GdkScreen *screen; gint request_width; gint request_height; - gint sc_width; - gint sc_height; ev_document_get_max_page_size (window->priv->document, &document_width, &document_height); @@ -1347,13 +1346,9 @@ setup_document_from_metadata (EvWindow *window) request_height = (gint)(height_ratio * document_height + 0.5); screen = gtk_window_get_screen (GTK_WINDOW (window)); - - gdk_window_get_geometry (gdk_screen_get_root_window (screen), NULL, NULL, - &sc_width, &sc_height); - if (screen) { - request_width = MIN (request_width, sc_width); - request_height = MIN (request_height, sc_height); + request_width = MIN (request_width, WidthOfScreen (gdk_x11_screen_get_xscreen (screen))); + request_height = MIN (request_height, HeightOfScreen (gdk_x11_screen_get_xscreen (screen))); } if (request_width > 0 && request_height > 0) { -- cgit v1.2.1