summaryrefslogtreecommitdiff
path: root/libdocument/ev-document-misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'libdocument/ev-document-misc.c')
-rw-r--r--libdocument/ev-document-misc.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/libdocument/ev-document-misc.c b/libdocument/ev-document-misc.c
index 1a07781c..e25b9ca6 100644
--- a/libdocument/ev-document-misc.c
+++ b/libdocument/ev-document-misc.c
@@ -339,16 +339,20 @@ ev_document_misc_invert_pixbuf (GdkPixbuf *pixbuf)
}
gdouble
-ev_document_misc_get_screen_dpi (GdkScreen *screen, GdkMonitor *monitor)
+ev_document_misc_get_monitor_dpi (GdkMonitor *monitor)
{
+ GdkRectangle geometry;
+ int s;
gdouble dp, di;
+ gdk_monitor_get_geometry (monitor, &geometry);
+ s = gdk_monitor_get_scale_factor (monitor);
+
/*diagonal in pixels*/
- dp = hypot (WidthOfScreen (gdk_x11_screen_get_xscreen (screen)), HeightOfScreen (gdk_x11_screen_get_xscreen (screen)));
+ dp = hypot (geometry.width * s, geometry.height * s);
/*diagonal in inches*/
di = hypot (gdk_monitor_get_width_mm(monitor), gdk_monitor_get_height_mm (monitor)) / 25.4;
- di /= gdk_monitor_get_scale_factor (monitor);
return (dp / di);
}