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 --- libdocument/ev-document-misc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'libdocument') diff --git a/libdocument/ev-document-misc.c b/libdocument/ev-document-misc.c index 529c5b97..88935c73 100644 --- a/libdocument/ev-document-misc.c +++ b/libdocument/ev-document-misc.c @@ -24,6 +24,7 @@ #include #include +#include #include "ev-document-misc.h" @@ -401,13 +402,9 @@ ev_document_misc_get_screen_dpi (GdkScreen *screen, gint monitor) #endif { gdouble dp, di; - gint sc_width, sc_height; - - gdk_window_get_geometry (gdk_screen_get_root_window (screen), NULL, NULL, - &sc_width, &sc_height); /*diagonal in pixels*/ - dp = hypot (sc_width, sc_height); + dp = hypot (WidthOfScreen (gdk_x11_screen_get_xscreen (screen)), HeightOfScreen (gdk_x11_screen_get_xscreen (screen))); /*diagonal in inches*/ #if GTK_CHECK_VERSION (3, 22, 0) -- cgit v1.2.1