summaryrefslogtreecommitdiff
path: root/libview
diff options
context:
space:
mode:
authorZenWalker <[email protected]>2017-08-20 04:35:51 +0200
committerraveit65 <[email protected]>2017-08-20 17:00:09 +0200
commit0568785bbd484714a63caa4b9ca9639a2867d6e9 (patch)
treeffcda2d32cb3b951a3e8d2c5c7e82204755e2cf7 /libview
parent444cec08e38299e5d6ae9489ae74d02f4e4a5f97 (diff)
downloadatril-0568785bbd484714a63caa4b9ca9639a2867d6e9.tar.bz2
atril-0568785bbd484714a63caa4b9ca9639a2867d6e9.tar.xz
gtk 3.22: avoid deprecated gdk_screen_get_monitor... functions:
avoid deprecated: gdk_screen_get_monitor_geometry gdk_screen_get_monitor_at_window gdk_screen_get_monitor_at_point
Diffstat (limited to 'libview')
-rw-r--r--libview/ev-view-presentation.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libview/ev-view-presentation.c b/libview/ev-view-presentation.c
index 40dea3ea..1dae35d5 100644
--- a/libview/ev-view-presentation.c
+++ b/libview/ev-view-presentation.c
@@ -1213,12 +1213,23 @@ static gboolean
init_presentation (GtkWidget *widget)
{
EvViewPresentation *pview = EV_VIEW_PRESENTATION (widget);
+#if GTK_CHECK_VERSION (3, 22, 0)
+ GdkDisplay *display = gtk_widget_get_display (widget);
+ GdkRectangle monitor;
+ GdkMonitor *monitor_num;
+#else
GdkScreen *screen = gtk_widget_get_screen (widget);
GdkRectangle monitor;
gint monitor_num;
+#endif
+#if GTK_CHECK_VERSION (3, 22, 0)
+ monitor_num = gdk_display_get_monitor_at_window (display, gtk_widget_get_window (widget));
+ gdk_monitor_get_geometry (monitor_num, &monitor);
+#else
monitor_num = gdk_screen_get_monitor_at_window (screen, gtk_widget_get_window (widget));
gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
+#endif
pview->monitor_width = monitor.width;
pview->monitor_height = monitor.height;