summaryrefslogtreecommitdiff
path: root/libdocument/ev-document-misc.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 /libdocument/ev-document-misc.c
parent4650fb05e46e144be986a11a666a47add39b3799 (diff)
downloadatril-d9fffe2dc0e33d6777099c18635b7b75f54d3d35.tar.bz2
atril-d9fffe2dc0e33d6777099c18635b7b75f54d3d35.tar.xz
avoid deprecated gdk_screen_get_width/height
Diffstat (limited to 'libdocument/ev-document-misc.c')
-rw-r--r--libdocument/ev-document-misc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libdocument/ev-document-misc.c b/libdocument/ev-document-misc.c
index fc47a9ee..e59eb354 100644
--- a/libdocument/ev-document-misc.c
+++ b/libdocument/ev-document-misc.c
@@ -375,9 +375,13 @@ gdouble
ev_document_misc_get_screen_dpi (GdkScreen *screen, gint monitor)
{
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 (gdk_screen_get_width (screen), gdk_screen_get_height (screen));
+ dp = hypot (sc_width, sc_height);
/*diagonal in inches*/
di = hypot (gdk_screen_get_width_mm(screen), gdk_screen_get_height_mm (screen)) / 25.4;