summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
Diffstat (limited to 'shell')
-rw-r--r--shell/ev-window.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/shell/ev-window.c b/shell/ev-window.c
index ca906be3..f15a74da 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -383,11 +383,21 @@ G_DEFINE_TYPE (EvWindow, ev_window, GTK_TYPE_WINDOW)
static gdouble
get_screen_dpi (EvWindow *window)
{
- GdkScreen *screen;
- gint monitor;
+ GdkScreen *screen;
+#if GTK_CHECK_VERSION (3, 22, 0)
+ GdkMonitor *monitor;
+ GdkDisplay *display;
+#else
+ gint monitor;
+#endif
screen = gtk_window_get_screen (GTK_WINDOW (window));
+#if GTK_CHECK_VERSION (3, 22, 0)
+ display = gdk_screen_get_display (screen);
+ monitor = gdk_display_get_primary_monitor (display);
+#else
monitor = gdk_screen_get_primary_monitor (screen);
+#endif
return ev_document_misc_get_screen_dpi (screen, monitor);
}