summaryrefslogtreecommitdiff
path: root/libmate-desktop
diff options
context:
space:
mode:
authorZenWalker <[email protected]>2017-08-05 00:07:46 +0200
committerraveit65 <[email protected]>2017-08-05 17:12:05 +0200
commit63bef64967f5f047f6832aac7efcce7203366609 (patch)
tree5e3869232f642c92b64825643daf27012701db4b /libmate-desktop
parent421ced2a99d9ce2b6b32258a2d11c86f1e90c353 (diff)
downloadmate-desktop-63bef64967f5f047f6832aac7efcce7203366609.tar.bz2
mate-desktop-63bef64967f5f047f6832aac7efcce7203366609.tar.xz
avoid deprecated gdk_screen_get_n_monitors
Diffstat (limited to 'libmate-desktop')
-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++) {