summaryrefslogtreecommitdiff
path: root/src/themes/standard
diff options
context:
space:
mode:
authorZenWalker <[email protected]>2017-08-29 01:27:00 +0200
committerZenWalker <[email protected]>2017-08-29 01:57:52 +0200
commitc556e09077bb820e752d7266d2b20328db629883 (patch)
tree66c4050eb094338be849f9a2343ff910ad6f3a12 /src/themes/standard
parent52b7c3807e71278f2d902a79cf6c08c839a1b0ad (diff)
downloadmate-notification-daemon-c556e09077bb820e752d7266d2b20328db629883.tar.bz2
mate-notification-daemon-c556e09077bb820e752d7266d2b20328db629883.tar.xz
gtk 3.22: avoid deprecated gdk_screen_get_monitor... functions:
avoid deprecated: gdk_screen_get_monitor_geometry gdk_screen_get_monitor_at_point
Diffstat (limited to 'src/themes/standard')
-rw-r--r--src/themes/standard/theme.c22
1 files changed, 22 insertions, 0 deletions
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;