summaryrefslogtreecommitdiff
path: root/libdocument/ev-document-misc.c
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2017-12-10 02:53:45 +0100
committerPablo Barciela <[email protected]>2017-12-10 03:12:31 +0100
commitc4911e303edd2352597ec5879df1137fd0a83274 (patch)
tree4fb57ea9e98291b879709b26ce697c86b8d11c2d /libdocument/ev-document-misc.c
parentdd2c555654cd4beeec3cfc64481024982dbcbaa3 (diff)
downloadatril-c4911e303edd2352597ec5879df1137fd0a83274.tar.bz2
atril-c4911e303edd2352597ec5879df1137fd0a83274.tar.xz
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
Diffstat (limited to 'libdocument/ev-document-misc.c')
-rw-r--r--libdocument/ev-document-misc.c7
1 files changed, 2 insertions, 5 deletions
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 <math.h>
#include <gtk/gtk.h>
+#include <gdk/gdkx.h>
#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)