[gnome-control-center] background: Fix CI build breaking on gnome-desktop API change



commit baed38e31c3cbc51a80af5be388c75c6c7ad9138
Author: Robert Ancell <robert ancell canonical com>
Date:   Wed Jan 22 11:53:14 2020 +1300

    background: Fix CI build breaking on gnome-desktop API change
    
    The change was added in feeee1c. For now we will handle the old and the new API
    until this can be built.

 meson.build                            | 2 +-
 panels/background/cc-background-item.c | 4 ++++
 panels/background/meson.build          | 4 ++++
 3 files changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/meson.build b/meson.build
index 5488434c1..5ad524786 100644
--- a/meson.build
+++ b/meson.build
@@ -121,7 +121,7 @@ colord_dep = dependency('colord', version: '>= 0.1.34')
 gdk_pixbuf_dep = dependency('gdk-pixbuf-2.0', version: '>= 2.23.0')
 gio_dep = dependency('gio-2.0')
 glib_dep = dependency('glib-2.0', version: '>= 2.56.0')
-gnome_desktop_dep = dependency('gnome-desktop-3.0', version: '>= 3.35.4')
+gnome_desktop_dep = dependency('gnome-desktop-3.0', version: '>= 3.27.90')
 gnome_settings_dep = dependency('gnome-settings-daemon', version: '>= 3.27.90')
 goa_dep = dependency('goa-1.0', version: goa_req_version)
 gsettings_desktop_dep = dependency('gsettings-desktop-schemas', version: '>= 3.31.0')
diff --git a/panels/background/cc-background-item.c b/panels/background/cc-background-item.c
index 50851e17d..cb6bea28d 100644
--- a/panels/background/cc-background-item.c
+++ b/panels/background/cc-background-item.c
@@ -156,7 +156,11 @@ render_at_size (GnomeBG *bg,
         GdkPixbuf *pixbuf;
 
         pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, width, height);
+#ifdef GNOME_DESKTOP_BG_API_BREAK
         gnome_bg_draw (bg, pixbuf);
+#else
+        gnome_bg_draw (bg, pixbuf, gdk_screen_get_default (), FALSE);
+#endif
 
         return pixbuf;
 }
diff --git a/panels/background/meson.build b/panels/background/meson.build
index 71e38f098..e9fa398d4 100644
--- a/panels/background/meson.build
+++ b/panels/background/meson.build
@@ -102,6 +102,10 @@ cflags += [
   '-DGNOME_DESKTOP_USE_UNSTABLE_API'
 ]
 
+if gnome_desktop_dep.version().version_compare('>=3.35.4')
+  cflags += '-DGNOME_DESKTOP_BG_API_BREAK'
+endif
+
 panels_libs += static_library(
   cappletname,
   sources: sources,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]