Merge lp:~unity-team/compiz/x-sru3 into lp:compiz/xenial

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Andrea Azzarone
Approved revision: no longer in the source branch.
Merged at revision: 4015
Proposed branch: lp:~unity-team/compiz/x-sru3
Merge into: lp:compiz/xenial
Diff against target: 268 lines (+76/-40)
9 files modified
compizconfig/gsettings/gsettings_backend_shared/ccs_gsettings_interface_wrapper.c (+27/-3)
compizconfig/gsettings/gsettings_backend_shared/gsettings_util.c (+12/-11)
compizconfig/gsettings/gsettings_backend_shared/gsettings_util.h (+1/-1)
compizconfig/gsettings/tests/test_gsettings_tests.cpp (+3/-3)
debian/00_remove_obsolete_plugins_in_unity_session_v3.py (+13/-6)
debian/changelog (+16/-0)
debian/compiz-gnome.migrations (+1/-1)
plugins/expo/src/expo.cpp (+2/-1)
src/screen.cpp (+1/-14)
To merge this branch: bzr merge lp:~unity-team/compiz/x-sru3
Reviewer Review Type Date Requested Status
Andrea Azzarone Approve
Review via email: mp+301627@code.launchpad.net

Commit message

Releasing Compiz SRU3

To post a comment you must log in.
Revision history for this message
Andrea Azzarone (azzar1) wrote :

+1

review: Approve
lp:~unity-team/compiz/x-sru3 updated
4018. By Marco Trevisan (Treviño)

remove_obsolete_plugins_in_unity_session: use proper variable name for core settings

And add some cleanup to avoid repeating key strings

4019. By Andrea Azzarone

focusDefaultWindow: focus Most Recently Used (MRU) window and fallback to the top window in case MRU list is not available.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'compizconfig/gsettings/gsettings_backend_shared/ccs_gsettings_interface_wrapper.c'
2--- compizconfig/gsettings/gsettings_backend_shared/ccs_gsettings_interface_wrapper.c 2013-05-13 13:23:20 +0000
3+++ compizconfig/gsettings/gsettings_backend_shared/ccs_gsettings_interface_wrapper.c 2016-08-01 13:38:33 +0000
4@@ -15,25 +15,49 @@
5 #define GSETTINGS_WRAPPER_PRIVATE(w) \
6 CCSGSettingsWrapperPrivate *gswPrivate = (CCSGSettingsWrapperPrivate *) ccsObjectGetPrivate (w);
7
8+static Bool keyIsValid (GSettings *settings, const char *key)
9+{
10+ GSettingsSchema *schema;
11+ Bool valid = FALSE;
12+
13+ if (!settings)
14+ return valid;
15+
16+ g_object_get (settings, "settings-schema", &schema, NULL);
17+
18+ if (schema)
19+ {
20+ valid = g_settings_schema_has_key (schema, key);
21+ g_settings_schema_unref (schema);
22+ }
23+
24+ return valid;
25+}
26+
27 static GVariant * ccsGSettingsWrapperGetValueDefault (CCSGSettingsWrapper *wrapper, const char *key)
28 {
29 GSETTINGS_WRAPPER_PRIVATE (wrapper);
30
31- return g_settings_get_value (gswPrivate->settings, key);
32+ if (keyIsValid (gswPrivate->settings, key))
33+ return g_settings_get_value (gswPrivate->settings, key);
34+ else
35+ return NULL;
36 }
37
38 static void ccsGSettingsWrapperSetValueDefault (CCSGSettingsWrapper *wrapper, const char *key, GVariant *variant)
39 {
40 GSETTINGS_WRAPPER_PRIVATE (wrapper);
41
42- g_settings_set_value (gswPrivate->settings, key, variant);
43+ if (keyIsValid (gswPrivate->settings, key))
44+ g_settings_set_value (gswPrivate->settings, key, variant);
45 }
46
47 static void ccsGSettingsWrapperResetKeyDefault (CCSGSettingsWrapper *wrapper, const char *key)
48 {
49 GSETTINGS_WRAPPER_PRIVATE (wrapper);
50
51- g_settings_reset (gswPrivate->settings, key);
52+ if (keyIsValid (gswPrivate->settings, key))
53+ g_settings_reset (gswPrivate->settings, key);
54 }
55
56 static char ** ccsGSettingsWrapperListKeysDefault (CCSGSettingsWrapper *wrapper)
57
58=== modified file 'compizconfig/gsettings/gsettings_backend_shared/gsettings_util.c'
59--- compizconfig/gsettings/gsettings_backend_shared/gsettings_util.c 2013-05-13 13:23:20 +0000
60+++ compizconfig/gsettings/gsettings_backend_shared/gsettings_util.c 2016-08-01 13:38:33 +0000
61@@ -452,24 +452,24 @@
62 }
63
64 Bool
65-checkReadVariantIsValid (GVariant *gsettingsValue, CCSSettingType type, const gchar *pathName)
66+checkReadVariantIsValid (GVariant *gsettingsValue, CCSSettingType type, const gchar *pathName, const gchar *key)
67 {
68 /* first check if the key is set */
69 if (!gsettingsValue)
70 {
71- ccsWarning ("There is no key at the path %s. "
72- "Settings from this path won't be read. Try to remove "
73- "that value so that operation can continue properly.",
74- pathName);
75+ ccsWarning ("There is no key '%s' at the path %s. "
76+ "Settings from this path won't be read. Default value will be used."
77+ "Ensure this setting is available or the setting backend is properly configured.",
78+ key, pathName);
79 return FALSE;
80 }
81
82 if (!variantIsValidForCCSType (gsettingsValue, type))
83 {
84- ccsWarning ("There is an unsupported value at path %s. "
85- "Settings from this path won't be read. Try to remove "
86- "that value so that operation can continue properly.",
87- pathName);
88+ ccsWarning ("There is an unsupported value for key '%s' at path %s. "
89+ "Settings from this path won't be read. Default value will be used. "
90+ "Ensure this setting is available or the setting backend is properly configured.",
91+ key, pathName);
92 return FALSE;
93 }
94
95@@ -481,9 +481,10 @@
96 {
97 GVariant *gsettingsValue = ccsGSettingsWrapperGetValue (settings, key);
98
99- if (!checkReadVariantIsValid (gsettingsValue, type, pathName))
100+ if (!checkReadVariantIsValid (gsettingsValue, type, pathName, key))
101 {
102- g_variant_unref (gsettingsValue);
103+ if (gsettingsValue)
104+ g_variant_unref (gsettingsValue);
105 return NULL;
106 }
107
108
109=== modified file 'compizconfig/gsettings/gsettings_backend_shared/gsettings_util.h'
110--- compizconfig/gsettings/gsettings_backend_shared/gsettings_util.h 2012-11-13 15:51:59 +0000
111+++ compizconfig/gsettings/gsettings_backend_shared/gsettings_util.h 2016-08-01 13:38:33 +0000
112@@ -109,7 +109,7 @@
113 getNameForCCSSetting (CCSSetting *setting);
114
115 Bool
116-checkReadVariantIsValid (GVariant *gsettingsValue, CCSSettingType type, const gchar *pathName);
117+checkReadVariantIsValid (GVariant *gsettingsValue, CCSSettingType type, const gchar *pathName, const gchar *key);
118
119 GVariant *
120 getVariantAtKey (CCSGSettingsWrapper *settings, const char *key, const char *pathName, CCSSettingType type);
121
122=== modified file 'compizconfig/gsettings/tests/test_gsettings_tests.cpp'
123--- compizconfig/gsettings/tests/test_gsettings_tests.cpp 2013-05-13 15:49:42 +0000
124+++ compizconfig/gsettings/tests/test_gsettings_tests.cpp 2016-08-01 13:38:33 +0000
125@@ -1207,14 +1207,14 @@
126
127 TEST_F(CCSGSettingsTestIndependent, TestReadVariantIsValidNULL)
128 {
129- EXPECT_FALSE (checkReadVariantIsValid (NULL, TypeNum, "foo/bar"));
130+ EXPECT_FALSE (checkReadVariantIsValid (NULL, TypeNum, "foo/bar", "key"));
131 }
132
133 TEST_F(CCSGSettingsTestIndependent, TestReadVariantIsValidTypeBad)
134 {
135 GVariant *v = g_variant_new ("i", 1);
136
137- EXPECT_FALSE (checkReadVariantIsValid (v, TypeString, "foo/bar"));
138+ EXPECT_FALSE (checkReadVariantIsValid (v, TypeString, "foo/bar", "key"));
139
140 g_variant_unref (v);
141 }
142@@ -1223,7 +1223,7 @@
143 {
144 GVariant *v = g_variant_new ("i", 1);
145
146- EXPECT_TRUE (checkReadVariantIsValid (v, TypeInt, "foo/bar"));
147+ EXPECT_TRUE (checkReadVariantIsValid (v, TypeInt, "foo/bar", "key"));
148
149 g_variant_unref (v);
150 }
151
152=== renamed file 'debian/00_remove_obsolete_plugins_in_unity_session_v1.py' => 'debian/00_remove_obsolete_plugins_in_unity_session_v3.py'
153--- debian/00_remove_obsolete_plugins_in_unity_session_v1.py 2016-07-14 15:51:19 +0000
154+++ debian/00_remove_obsolete_plugins_in_unity_session_v3.py 2016-08-01 13:38:33 +0000
155@@ -24,6 +24,7 @@
156 COMPIZ_SCHEMA = "org.compiz"
157 COMPIZ_CORE_PATH = "/org/compiz/profiles/{}/plugins/core/"
158 UNITY_PROFILES = ["unity", "unity-lowgfx"]
159+ACTIVE_PLUGINS_KEY = "active-plugins"
160 OBSOLETE_PLUGINS = ["decor", "gnomecompat", "scalefilter"]
161
162 if COMPIZ_SCHEMA not in Gio.Settings.list_schemas():
163@@ -33,7 +34,7 @@
164 for profile in UNITY_PROFILES:
165 core_profile_path = COMPIZ_CORE_PATH.format(profile)
166 core_settings = Gio.Settings(schema=COMPIZ_SCHEMA+".core", path=core_profile_path)
167- active_plugins = core_settings.get_strv("active-plugins")
168+ active_plugins = core_settings.get_strv(ACTIVE_PLUGINS_KEY)
169
170 for plugin in OBSOLETE_PLUGINS:
171 if not plugin in active_plugins:
172@@ -45,8 +46,14 @@
173 except ValueError:
174 pass
175
176- # gsettings doesn't work directly, the key is somewhat reverted. Work one level under then: dconf!
177- # gsettings.set_strv("active-plugins", active_plugins)
178- from subprocess import Popen, PIPE, STDOUT
179- p = Popen(("dconf load "+core_profile_path).split(), stdout=PIPE, stdin=PIPE, stderr=STDOUT)
180- p.communicate(input=bytes("[/]\nactive-plugins={}".format(active_plugins), 'utf-8'))
181+ core_settings.set_strv(ACTIVE_PLUGINS_KEY, active_plugins)
182+ Gio.Settings.sync()
183+
184+ # Sometimes settings don't get written correctly, so in case we fallback to dconf
185+ if core_settings.get_strv(ACTIVE_PLUGINS_KEY) != active_plugins:
186+ try:
187+ from subprocess import Popen, PIPE, STDOUT
188+ p = Popen(("dconf load "+core_profile_path).split(), stdout=PIPE, stdin=PIPE, stderr=STDOUT)
189+ p.communicate(input=bytes("[/]\nactive-plugins={}".format(active_plugins), 'utf-8'))
190+ except:
191+ pass
192
193=== modified file 'debian/changelog'
194--- debian/changelog 2016-07-14 16:00:57 +0000
195+++ debian/changelog 2016-08-01 13:38:33 +0000
196@@ -1,3 +1,19 @@
197+compiz (1:0.9.12.2+16.04.20160714-0ubuntu2) UNRELEASED; urgency=medium
198+
199+ [ Andrea Azzarone ]
200+ * Don't activate expo if not needed (1x1 setup) (LP: #1606254)
201+ * Don't crash if gsettings key is not found. Default value will be
202+ used. (LP: #1044662)
203+ * focusDefaultWindow: focus Most Recently Used (MRU) window and
204+ fallback to the top window in case MRU list is not available. (LP:
205+ #1073488, LP: #1459671)
206+
207+ [ Marco Trevisan (Treviño) ]
208+ * Unity MigrationScript: sync gsettings on exit, and only use dconf on
209+ failure (LP: #1605011)
210+
211+ -- Andrea Azzarone <azzaronea@gmail.com> Mon, 01 Aug 2016 11:16:13 +0200
212+
213 compiz (1:0.9.12.2+16.04.20160714-0ubuntu1) xenial; urgency=medium
214
215 [ Eleni Maria Stea ]
216
217=== modified file 'debian/compiz-gnome.migrations'
218--- debian/compiz-gnome.migrations 2016-07-14 15:51:19 +0000
219+++ debian/compiz-gnome.migrations 2016-08-01 13:38:33 +0000
220@@ -1,1 +1,1 @@
221-debian/00_remove_obsolete_plugins_in_unity_session_v1.py
222+debian/00_remove_obsolete_plugins_in_unity_session_v3.py
223
224=== modified file 'plugins/expo/src/expo.cpp'
225--- plugins/expo/src/expo.cpp 2016-07-05 01:11:30 +0000
226+++ plugins/expo/src/expo.cpp 2016-08-01 13:38:33 +0000
227@@ -92,7 +92,8 @@
228 CompAction::State state,
229 CompOption::Vector &options)
230 {
231- if (screen->otherGrabExist ("expo", NULL))
232+ if (screen->otherGrabExist ("expo", NULL) ||
233+ (screen->vpSize ().width () == 1 && screen->vpSize ().height () == 1))
234 return false;
235
236 if (!expoMode)
237
238=== modified file 'src/screen.cpp'
239--- src/screen.cpp 2016-05-17 02:52:07 +0000
240+++ src/screen.cpp 2016-08-01 13:38:33 +0000
241@@ -2782,26 +2782,13 @@
242 CompWindowTypeDialogMask |
243 CompWindowTypeModalDialogMask))
244 {
245- if (!privateScreen.optionGetClickToFocus ())
246- {
247- /* We should favor the more active window in the mouse focus
248- * case since the user does not care if the focused window is on top */
249- if (PrivateWindow::compareWindowActiveness (focus, w) < 0)
250- focus = w;
251- }
252- else
253- {
254+ if (PrivateWindow::compareWindowActiveness (focus, w) < 0)
255 focus = w;
256- break;
257- }
258 }
259 }
260 else
261 {
262 focus = w;
263-
264- if (privateScreen.optionGetClickToFocus ())
265- break;
266 }
267 }
268 }

Subscribers

People subscribed via source and target branches

to all changes: