From c556e09077bb820e752d7266d2b20328db629883 Mon Sep 17 00:00:00 2001
From: ZenWalker <scow@riseup.net>
Date: Tue, 29 Aug 2017 01:27:00 +0200
Subject: gtk 3.22: avoid deprecated gdk_screen_get_monitor... functions:

avoid deprecated:

gdk_screen_get_monitor_geometry
gdk_screen_get_monitor_at_point
---
 src/themes/standard/theme.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

(limited to 'src/themes')

diff --git a/src/themes/standard/theme.c b/src/themes/standard/theme.c
index c4a75d6..3366736 100644
--- a/src/themes/standard/theme.c
+++ b/src/themes/standard/theme.c
@@ -266,13 +266,24 @@ static GtkArrowType get_notification_arrow_type(GtkWidget* nw)
 	WindowData*     windata;
 	GdkScreen*      screen;
 	GdkRectangle    monitor_geometry;
+#if GTK_CHECK_VERSION (3, 22, 0)
+	GdkDisplay*     display;
+	GdkMonitor*     monitor;
+#else
 	int             monitor;
+#endif
 
 	windata = g_object_get_data(G_OBJECT(nw), "windata");
 
 	screen = gdk_window_get_screen(GDK_WINDOW( gtk_widget_get_window(nw)));
+#if GTK_CHECK_VERSION (3, 22, 0)
+	display = gdk_screen_get_display (screen);
+	monitor = gdk_display_get_monitor_at_point (display, windata->point_x, windata->point_y);
+	gdk_monitor_get_geometry (monitor, &monitor_geometry);
+#else
 	monitor = gdk_screen_get_monitor_at_point(screen, windata->point_x, windata->point_y);
 	gdk_screen_get_monitor_geometry(screen, monitor, &monitor_geometry);
+#endif
 
 	if (windata->point_y - monitor_geometry.y + windata->height + DEFAULT_ARROW_HEIGHT > monitor_geometry.height)
 	{
@@ -307,15 +318,26 @@ static void create_border_with_arrow(GtkWidget* nw, WindowData* windata)
 	int             arrow_offset = DEFAULT_ARROW_OFFSET;
 	GdkPoint*       shape_points = NULL;
 	int             i = 0;
+#if GTK_CHECK_VERSION (3, 22, 0)
+	GdkMonitor*     monitor;
+	GdkDisplay*     display;
+#else
 	int             monitor;
+#endif
 	GdkRectangle    monitor_geometry;
 
 	width = windata->width;
 	height = windata->height;
 
 	screen = gdk_window_get_screen(GDK_WINDOW(gtk_widget_get_window(nw)));
+#if GTK_CHECK_VERSION (3, 22, 0)
+	display = gdk_screen_get_display (screen);
+	monitor = gdk_display_get_monitor_at_point (display, windata->point_x, windata->point_y);
+	gdk_monitor_get_geometry (monitor, &monitor_geometry);
+#else
 	monitor = gdk_screen_get_monitor_at_point(screen, windata->point_x, windata->point_y);
 	gdk_screen_get_monitor_geometry(screen, monitor, &monitor_geometry);
+#endif
 
 	windata->num_border_points = 5;
 
-- 
cgit v1.2.1