From 63bef64967f5f047f6832aac7efcce7203366609 Mon Sep 17 00:00:00 2001 From: ZenWalker Date: Sat, 5 Aug 2017 00:07:46 +0200 Subject: avoid deprecated gdk_screen_get_n_monitors --- libmate-desktop/mate-bg.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/libmate-desktop/mate-bg.c b/libmate-desktop/mate-bg.c index 82e66ce..36198f9 100644 --- a/libmate-desktop/mate-bg.c +++ b/libmate-desktop/mate-bg.c @@ -844,11 +844,19 @@ draw_color_each_monitor (MateBG *bg, GdkPixbuf *dest, GdkScreen *screen) { +#if GTK_CHECK_VERSION (3, 22, 0) + GdkDisplay *display; +#endif GdkRectangle rect; gint num_monitors; int monitor; +#if GTK_CHECK_VERSION (3, 22, 0) + display = gdk_screen_get_display (screen); + num_monitors = gdk_display_get_n_monitors (display); +#else num_monitors = gdk_screen_get_n_monitors (screen); +#endif for (monitor = 0; monitor < num_monitors; monitor++) { gdk_screen_get_monitor_geometry (screen, monitor, &rect); draw_color_area (bg, dest, &rect); @@ -1021,7 +1029,14 @@ draw_each_monitor (MateBG *bg, GdkPixbuf *dest, GdkScreen *screen) { +#if GTK_CHECK_VERSION (3, 22, 0) + GdkDisplay *display; + + display = gdk_screen_get_display (screen); + gint num_monitors = gdk_display_get_n_monitors (display); +#else gint num_monitors = gdk_screen_get_n_monitors (screen); +#endif gint monitor = 0; for (; monitor < num_monitors; monitor++) { -- cgit v1.2.1