From 444cec08e38299e5d6ae9489ae74d02f4e4a5f97 Mon Sep 17 00:00:00 2001 From: ZenWalker Date: Sun, 20 Aug 2017 03:29:36 +0200 Subject: avoid gdk_screen_get_primary_monitor/gdk_screen_get_monitor_scale_factor --- libview/ev-annotation-window.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'libview') diff --git a/libview/ev-annotation-window.c b/libview/ev-annotation-window.c index 15bdce5a..eadb6d65 100644 --- a/libview/ev-annotation-window.c +++ b/libview/ev-annotation-window.c @@ -96,11 +96,21 @@ send_focus_change (GtkWidget *widget, static gdouble get_screen_dpi (EvAnnotationWindow *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); } -- cgit v1.2.1