Merge ~khurshid-alam/unity:drop-gnomebg into unity:master

Proposed by Khurshid Alam
Status: Merged
Merge reported by: Sebastien Bacher
Merged at revision: 8fc00185abe732c2f7018d2ab27b2731ffa9633a
Proposed branch: ~khurshid-alam/unity:drop-gnomebg
Merge into: unity:master
Diff against target: 107 lines (+15/-12)
4 files modified
CMakeLists.txt (+1/-0)
debian/control (+2/-0)
lockscreen/BackgroundSettings.cpp (+10/-10)
lockscreen/BackgroundSettings.h (+2/-2)
Reviewer Review Type Date Requested Status
Sebastien Bacher Approve
Review via email: mp+379828@code.launchpad.net

Commit message

Drop libgnome-desktop for background drawing. Use libunity-settings-daemon instead. LP: #1863584

Description of the change

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/CMakeLists.txt b/CMakeLists.txt
2index 249b8fc..e12a71a 100644
3--- a/CMakeLists.txt
4+++ b/CMakeLists.txt
5@@ -245,6 +245,7 @@ set(UNITY_PLUGIN_SHARED_DEPS
6 json-glib-1.0
7 libbamf3>=0.5.3
8 gnome-desktop-3.0
9+ libunity-settings-daemon
10 libnotify
11 libstartup-notification-1.0
12 nux-4.0>=4.0.5
13diff --git a/debian/control b/debian/control
14index 05ea690..5018833 100644
15--- a/debian/control
16+++ b/debian/control
17@@ -27,6 +27,8 @@ Build-Depends: cmake,
18 libgl1-mesa-dri,
19 libglib2.0-dev (>= 2.39.1),
20 libgnome-desktop-3-dev,
21+ libunity-settings-daemon-dev,
22+ unity-settings-daemon-dev,
23 libgtest-dev,
24 libgtk-3-dev (>= 3.1),
25 libido3-0.1-dev (>= 13.10.0),
26diff --git a/lockscreen/BackgroundSettings.cpp b/lockscreen/BackgroundSettings.cpp
27index 7ef4c6b..896c032 100644
28--- a/lockscreen/BackgroundSettings.cpp
29+++ b/lockscreen/BackgroundSettings.cpp
30@@ -20,7 +20,7 @@
31 #include <Nux/Nux.h>
32 #include "BackgroundSettings.h"
33
34-#include <libgnome-desktop/gnome-bg.h>
35+#include <libunity-settings-daemon/gsd-bg.h>
36
37 #include "LockScreenSettings.h"
38 #include "unity-shared/CairoTexture.h"
39@@ -40,10 +40,10 @@ inline int GetGridOffset(int size) { return (size % Settings::GRID_SIZE) / 2; }
40 }
41
42 BackgroundSettings::BackgroundSettings()
43- : gnome_bg_(gnome_bg_new())
44+ : gsd_bg_(gsd_bg_new())
45 {
46 glib::Object<GSettings> settings(g_settings_new(SETTINGS_NAME.c_str()));
47- gnome_bg_load_from_preferences(gnome_bg_, settings);
48+ gsd_bg_load_from_preferences(gsd_bg_, settings);
49 }
50
51 BaseTexturePtr BackgroundSettings::GetBackgroundTexture(int monitor)
52@@ -55,26 +55,26 @@ BaseTexturePtr BackgroundSettings::GetBackgroundTexture(int monitor)
53 nux::CairoGraphics cairo_graphics(CAIRO_FORMAT_ARGB32, geo.width, geo.height);
54 cairo_t* c = cairo_graphics.GetInternalContext();
55
56- glib::Object<GnomeBG> gnome_bg;
57+ glib::Object<GsdBG> gsd_bg;
58 double s_width = geo.width / scale;
59 double s_height = geo.height / scale;
60 cairo_surface_t* bg_surface = nullptr;
61
62 if (settings.use_user_background())
63 {
64- gnome_bg = gnome_bg_;
65+ gsd_bg = gsd_bg_;
66 }
67 else if (!settings.background().empty())
68 {
69- gnome_bg = gnome_bg_new();
70- gnome_bg_set_filename(gnome_bg, settings.background().c_str());
71- gnome_bg_set_placement(gnome_bg, G_DESKTOP_BACKGROUND_STYLE_ZOOM);
72+ gsd_bg = gsd_bg_new();
73+ gsd_bg_set_filename(gsd_bg, settings.background().c_str());
74+ gsd_bg_set_placement(gsd_bg, G_DESKTOP_BACKGROUND_STYLE_ZOOM);
75 }
76
77- if (gnome_bg)
78+ if (gsd_bg)
79 {
80 auto *root_window = gdk_get_default_root_window();
81- bg_surface = gnome_bg_create_surface(gnome_bg, root_window, geo.width, geo.height, FALSE);
82+ bg_surface = gsd_bg_create_surface(gsd_bg, root_window, geo.width, geo.height, FALSE);
83 }
84
85 auto const& bg_color = settings.background_color();
86diff --git a/lockscreen/BackgroundSettings.h b/lockscreen/BackgroundSettings.h
87index 2176cb3..161709f 100644
88--- a/lockscreen/BackgroundSettings.h
89+++ b/lockscreen/BackgroundSettings.h
90@@ -28,7 +28,7 @@ namespace nux
91 class BaseTexture;
92 }
93
94-class _GnomeBG;
95+class _GsdBG;
96
97 namespace unity
98 {
99@@ -45,7 +45,7 @@ public:
100 BaseTexturePtr GetBackgroundTexture(int monitor);
101
102 private:
103- glib::Object<_GnomeBG> gnome_bg_;
104+ glib::Object<_GsdBG> gsd_bg_;
105 };
106
107 }

Subscribers

People subscribed via source and target branches