summaryrefslogtreecommitdiff
path: root/shell/ev-window.c
diff options
context:
space:
mode:
authorZenWalker <[email protected]>2017-08-19 01:40:38 +0200
committerraveit65 <[email protected]>2017-08-20 17:00:09 +0200
commitd9fffe2dc0e33d6777099c18635b7b75f54d3d35 (patch)
tree534278c6d1090d27cb6fe05f9ab73078cb15df2b /shell/ev-window.c
parent4650fb05e46e144be986a11a666a47add39b3799 (diff)
downloadatril-d9fffe2dc0e33d6777099c18635b7b75f54d3d35.tar.bz2
atril-d9fffe2dc0e33d6777099c18635b7b75f54d3d35.tar.xz
avoid deprecated gdk_screen_get_width/height
Diffstat (limited to 'shell/ev-window.c')
-rw-r--r--shell/ev-window.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/shell/ev-window.c b/shell/ev-window.c
index b82d137f..ca906be3 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -1299,6 +1299,8 @@ 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);
@@ -1307,9 +1309,13 @@ 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, gdk_screen_get_width (screen));
- request_height = MIN (request_height, gdk_screen_get_height (screen));
+ request_width = MIN (request_width, sc_width);
+ request_height = MIN (request_height, sc_height);
}
if (request_width > 0 && request_height > 0) {