From 6f213290fe740621fc4d3f8bf20cbc6b47f5ea0c Mon Sep 17 00:00:00 2001 From: ZenWalker Date: Fri, 18 Aug 2017 02:57:02 +0200 Subject: gtk 3.22: avoid deprecated gdk_screen_get_monitor... functions: avoid deprecated: gdk_screen_get_monitor_geometry gdk_screen_get_monitor_at_window --- trashapplet/src/xstuff.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'trashapplet') diff --git a/trashapplet/src/xstuff.c b/trashapplet/src/xstuff.c index ae1a643a..5255bf0d 100644 --- a/trashapplet/src/xstuff.c +++ b/trashapplet/src/xstuff.c @@ -150,10 +150,14 @@ draw_zoom_animation (GdkScreen *gscreen, void xstuff_zoom_animate (GtkWidget *widget, GdkRectangle *opt_rect) { - GdkScreen *gscreen; - GdkRectangle rect, dest; + GdkScreen *gscreen; + GdkRectangle rect, dest; GtkAllocation allocation; - int monitor; +#if GTK_CHECK_VERSION (3, 22, 0) + GdkMonitor *monitor; +#else + int monitor; +#endif if (opt_rect) rect = *opt_rect; @@ -169,8 +173,14 @@ xstuff_zoom_animate (GtkWidget *widget, GdkRectangle *opt_rect) } gscreen = gtk_widget_get_screen (widget); +#if GTK_CHECK_VERSION (3, 22, 0) + monitor = gdk_display_get_monitor_at_window (gdk_screen_get_display (gscreen), + gtk_widget_get_window (widget)); + gdk_monitor_get_geometry (monitor, &dest); +#else monitor = gdk_screen_get_monitor_at_window (gscreen, gtk_widget_get_window (widget)); gdk_screen_get_monitor_geometry (gscreen, monitor, &dest); +#endif draw_zoom_animation (gscreen, rect.x, rect.y, rect.width, rect.height, -- cgit v1.2.1