summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libmate-desktop/mate-bg.c15
1 files changed, 15 insertions, 0 deletions
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++) {