Merge lp:~muktupavels/compiz/gwd-marco-gsettings into lp:compiz/0.9.12
- gwd-marco-gsettings
- Merge into 0.9.12
Proposed by
Alberts Muktupāvels
Status: | Merged |
---|---|
Approved by: | Marco Trevisan (Treviño) |
Approved revision: | 3999 |
Merged at revision: | 4002 |
Proposed branch: | lp:~muktupavels/compiz/gwd-marco-gsettings |
Merge into: | lp:compiz/0.9.12 |
Diff against target: |
553 lines (+254/-25) 6 files modified
gtk/window-decorator/gwd-settings-storage-gsettings.c (+143/-24) gtk/window-decorator/gwd-settings-storage-gsettings.h (+16/-0) gtk/window-decorator/settings.c (+3/-1) gtk/window-decorator/tests/CMakeLists.txt (+15/-0) gtk/window-decorator/tests/org.mate.marco.gschema.xml (+53/-0) gtk/window-decorator/tests/test_gwd_settings.cpp (+24/-0) |
To merge this branch: | bzr merge lp:~muktupavels/compiz/gwd-marco-gsettings |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Marco Trevisan (Treviño) | Approve | ||
Review via email:
|
Commit message
gtk-window-
Description of the change
This merge proposal makes gtk-window-
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'gtk/window-decorator/gwd-settings-storage-gsettings.c' |
2 | --- gtk/window-decorator/gwd-settings-storage-gsettings.c 2016-02-22 12:49:18 +0000 |
3 | +++ gtk/window-decorator/gwd-settings-storage-gsettings.c 2016-03-15 13:00:32 +0000 |
4 | @@ -18,6 +18,7 @@ |
5 | * Authored By: Sam Spilsbury <sam.spilsbury@canonical.com> |
6 | */ |
7 | #include <glib-object.h> |
8 | +#include <glib.h> |
9 | |
10 | #include <gio/gio.h> |
11 | |
12 | @@ -30,6 +31,7 @@ |
13 | const gchar * ORG_COMPIZ_GWD = "org.compiz.gwd"; |
14 | const gchar * ORG_GNOME_METACITY = "org.gnome.metacity"; |
15 | const gchar * ORG_GNOME_DESKTOP_WM_PREFERENCES = "org.gnome.desktop.wm.preferences"; |
16 | +const gchar * ORG_MATE_MARCO_GENERAL = "org.mate.Marco.general"; |
17 | |
18 | const gchar * ORG_COMPIZ_GWD_KEY_USE_TOOLTIPS = "use-tooltips"; |
19 | const gchar * ORG_COMPIZ_GWD_KEY_BLUR_TYPE = "blur-type"; |
20 | @@ -47,6 +49,13 @@ |
21 | const gchar * ORG_GNOME_DESKTOP_WM_PREFERENCES_TITLEBAR_USES_SYSTEM_FONT = "titlebar-uses-system-font"; |
22 | const gchar * ORG_GNOME_DESKTOP_WM_PREFERENCES_TITLEBAR_FONT = "titlebar-font"; |
23 | const gchar * ORG_GNOME_DESKTOP_WM_PREFERENCES_BUTTON_LAYOUT = "button-layout"; |
24 | +const gchar * ORG_MATE_MARCO_GENERAL_ACTION_DOUBLE_CLICK_TITLEBAR = "action-double-click-titlebar"; |
25 | +const gchar * ORG_MATE_MARCO_GENERAL_ACTION_MIDDLE_CLICK_TITLEBAR = "action-middle-click-titlebar"; |
26 | +const gchar * ORG_MATE_MARCO_GENERAL_ACTION_RIGHT_CLICK_TITLEBAR = "action-right-click-titlebar"; |
27 | +const gchar * ORG_MATE_MARCO_GENERAL_THEME = "theme"; |
28 | +const gchar * ORG_MATE_MARCO_GENERAL_TITLEBAR_USES_SYSTEM_FONT = "titlebar-uses-system-font"; |
29 | +const gchar * ORG_MATE_MARCO_GENERAL_TITLEBAR_FONT = "titlebar-font"; |
30 | +const gchar * ORG_MATE_MARCO_GENERAL_BUTTON_LAYOUT = "button-layout"; |
31 | |
32 | #define GWD_SETTINGS_STORAGE_GSETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GWD_TYPE_SETTINGS_STORAGE_GSETTINGS, GWDSettingsStorageGSettings)); |
33 | #define GWD_SETTINGS_STORAGE_GSETTINGS_CLASS(obj) (G_TYPE_CHECK_CLASS_CAST ((obj), GWD_TYPE_SETTINGS_STORAGE_GSETTINGS, GWDSettingsStorageGSettingsClass)); |
34 | @@ -76,14 +85,19 @@ |
35 | { |
36 | GWD_SETTINGS_STORAGE_GSETTINGS_PROPERTY_DESKTOP_GSETTINGS = 1, |
37 | GWD_SETTINGS_STORAGE_GSETTINGS_PROPERTY_METACITY_GSETTINGS = 2, |
38 | - GWD_SETTINGS_STORAGE_GSETTINGS_PROPERTY_GWD_GSETTINGS = 3, |
39 | - GWD_SETTINGS_STORAGE_GSETTINGS_PROPERTY_WRITABLE_SETTINGS = 4 |
40 | + GWD_SETTINGS_STORAGE_GSETTINGS_PROPERTY_MARCO_GSETTINGS = 3, |
41 | + GWD_SETTINGS_STORAGE_GSETTINGS_PROPERTY_GWD_GSETTINGS = 4, |
42 | + GWD_SETTINGS_STORAGE_GSETTINGS_PROPERTY_WRITABLE_SETTINGS = 5 |
43 | }; |
44 | |
45 | typedef struct _GWDSettingsStorageGSettingsPrivate |
46 | { |
47 | GSettings *desktop; |
48 | GSettings *metacity; |
49 | + |
50 | + GSettings *marco; |
51 | + gboolean is_mate_desktop; |
52 | + |
53 | GSettings *gwd; |
54 | GWDSettingsWritable *writable; |
55 | } GWDSettingsStorageGSettingsPrivate; |
56 | @@ -132,10 +146,12 @@ |
57 | |
58 | use_metacity_theme = g_settings_get_boolean (priv->gwd, ORG_COMPIZ_GWD_KEY_USE_METACITY_THEME); |
59 | |
60 | - if (!priv->metacity) |
61 | - return FALSE; |
62 | - |
63 | + if (priv->is_mate_desktop) |
64 | + theme = g_settings_get_string (priv->marco, ORG_MATE_MARCO_GENERAL_THEME); |
65 | + else if (priv->metacity) |
66 | theme = g_settings_get_string (priv->metacity, ORG_GNOME_METACITY_THEME); |
67 | + else |
68 | + return FALSE; |
69 | |
70 | return gwd_settings_writable_metacity_theme_changed (priv->writable, |
71 | use_metacity_theme, |
72 | @@ -167,13 +183,17 @@ |
73 | { |
74 | GWDSettingsStorageGSettings *storage = GWD_SETTINGS_STORAGE_GSETTINGS (settings); |
75 | GWDSettingsStorageGSettingsPrivate *priv = GET_PRIVATE (storage); |
76 | + gchar *button_layout; |
77 | |
78 | - if (!priv->desktop) |
79 | + if (priv->is_mate_desktop) |
80 | + button_layout = g_settings_get_string (priv->marco, ORG_MATE_MARCO_GENERAL_BUTTON_LAYOUT); |
81 | + else if (priv->desktop) |
82 | + button_layout = g_settings_get_string (priv->desktop, ORG_GNOME_DESKTOP_WM_PREFERENCES_BUTTON_LAYOUT); |
83 | + else |
84 | return FALSE; |
85 | |
86 | return gwd_settings_writable_button_layout_changed (priv->writable, |
87 | - g_settings_get_string (priv->desktop, |
88 | - ORG_GNOME_DESKTOP_WM_PREFERENCES_BUTTON_LAYOUT)); |
89 | + button_layout); |
90 | } |
91 | |
92 | static gboolean |
93 | @@ -181,15 +201,21 @@ |
94 | { |
95 | GWDSettingsStorageGSettings *storage = GWD_SETTINGS_STORAGE_GSETTINGS (settings); |
96 | GWDSettingsStorageGSettingsPrivate *priv = GET_PRIVATE (storage); |
97 | + gchar *titlebar_font; |
98 | + gboolean titlebar_system_font; |
99 | |
100 | - if (!priv->desktop) |
101 | + if (priv->is_mate_desktop) { |
102 | + titlebar_font = g_settings_get_string (priv->marco, ORG_MATE_MARCO_GENERAL_TITLEBAR_FONT); |
103 | + titlebar_system_font = g_settings_get_boolean (priv->marco, ORG_MATE_MARCO_GENERAL_TITLEBAR_USES_SYSTEM_FONT); |
104 | + } else if (priv->desktop) { |
105 | + titlebar_font = g_settings_get_string (priv->desktop, ORG_GNOME_DESKTOP_WM_PREFERENCES_TITLEBAR_FONT); |
106 | + titlebar_system_font = g_settings_get_boolean (priv->desktop, ORG_GNOME_DESKTOP_WM_PREFERENCES_TITLEBAR_USES_SYSTEM_FONT); |
107 | + } else |
108 | return FALSE; |
109 | |
110 | return gwd_settings_writable_font_changed (priv->writable, |
111 | - g_settings_get_boolean (priv->desktop, |
112 | - ORG_GNOME_DESKTOP_WM_PREFERENCES_TITLEBAR_USES_SYSTEM_FONT), |
113 | - g_settings_get_string (priv->desktop, |
114 | - ORG_GNOME_DESKTOP_WM_PREFERENCES_TITLEBAR_FONT)); |
115 | + titlebar_system_font, |
116 | + titlebar_font); |
117 | } |
118 | |
119 | static inline gchar * |
120 | @@ -215,19 +241,27 @@ |
121 | { |
122 | GWDSettingsStorageGSettings *storage = GWD_SETTINGS_STORAGE_GSETTINGS (settings); |
123 | GWDSettingsStorageGSettingsPrivate *priv = GET_PRIVATE (storage); |
124 | - |
125 | - if (!priv->desktop) |
126 | - return FALSE; |
127 | + gchar *double_click_action, *middle_click_action, *right_click_action; |
128 | |
129 | if (!priv->gwd) |
130 | return FALSE; |
131 | |
132 | - gchar *double_click_action = translate_dashes_to_underscores (g_settings_get_string (priv->desktop, |
133 | + if (priv->is_mate_desktop) { |
134 | + double_click_action = translate_dashes_to_underscores (g_settings_get_string (priv->marco, |
135 | + ORG_MATE_MARCO_GENERAL_ACTION_DOUBLE_CLICK_TITLEBAR)); |
136 | + middle_click_action = translate_dashes_to_underscores (g_settings_get_string (priv->marco, |
137 | + ORG_MATE_MARCO_GENERAL_ACTION_MIDDLE_CLICK_TITLEBAR)); |
138 | + right_click_action = translate_dashes_to_underscores (g_settings_get_string (priv->marco, |
139 | + ORG_MATE_MARCO_GENERAL_ACTION_RIGHT_CLICK_TITLEBAR)); |
140 | + } else if (priv->desktop) { |
141 | + double_click_action = translate_dashes_to_underscores (g_settings_get_string (priv->desktop, |
142 | ORG_GNOME_DESKTOP_WM_PREFERENCES_ACTION_DOUBLE_CLICK_TITLEBAR)); |
143 | - gchar *middle_click_action = translate_dashes_to_underscores (g_settings_get_string (priv->desktop, |
144 | + middle_click_action = translate_dashes_to_underscores (g_settings_get_string (priv->desktop, |
145 | ORG_GNOME_DESKTOP_WM_PREFERENCES_ACTION_MIDDLE_CLICK_TITLEBAR)); |
146 | - gchar *right_click_action = translate_dashes_to_underscores (g_settings_get_string (priv->desktop, |
147 | + right_click_action = translate_dashes_to_underscores (g_settings_get_string (priv->desktop, |
148 | ORG_GNOME_DESKTOP_WM_PREFERENCES_ACTION_RIGHT_CLICK_TITLEBAR)); |
149 | + } else |
150 | + return FALSE; |
151 | |
152 | return gwd_settings_writable_titlebar_actions_changed (priv->writable, |
153 | double_click_action, |
154 | @@ -280,6 +314,12 @@ |
155 | |
156 | priv->metacity = g_value_dup_object (value); |
157 | break; |
158 | + case GWD_SETTINGS_STORAGE_GSETTINGS_PROPERTY_MARCO_GSETTINGS: |
159 | + if (priv->marco) |
160 | + g_object_unref (priv->marco); |
161 | + |
162 | + priv->marco = g_value_dup_object (value); |
163 | + break; |
164 | case GWD_SETTINGS_STORAGE_GSETTINGS_PROPERTY_GWD_GSETTINGS: |
165 | if (priv->gwd) |
166 | g_object_unref (priv->gwd); |
167 | @@ -307,6 +347,9 @@ |
168 | if (priv->metacity) |
169 | g_object_unref (priv->metacity); |
170 | |
171 | + if (priv->marco) |
172 | + g_object_unref (priv->marco); |
173 | + |
174 | if (priv->gwd) |
175 | g_object_unref (priv->gwd); |
176 | } |
177 | @@ -334,6 +377,11 @@ |
178 | "GSettings Object for org.gnome.metacity", |
179 | G_TYPE_SETTINGS, |
180 | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY), |
181 | + g_param_spec_object ("marco-gsettings", |
182 | + ORG_MATE_MARCO_GENERAL, |
183 | + "GSettings Object for org.mate.Marco.general", |
184 | + G_TYPE_SETTINGS, |
185 | + G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY), |
186 | g_param_spec_object ("gwd-gsettings", |
187 | ORG_COMPIZ_GWD, |
188 | "GSettings Object for org.compiz.gwd", |
189 | @@ -363,28 +411,33 @@ |
190 | GWDSettingsStorage * |
191 | gwd_settings_storage_gsettings_new (GSettings *desktop, |
192 | GSettings *metacity, |
193 | + GSettings *marco, |
194 | GSettings *gwd, |
195 | GWDSettingsWritable *writable) |
196 | { |
197 | - static const guint gwd_settings_storage_gsettings_n_construction_params = 4; |
198 | + static const guint gwd_settings_storage_gsettings_n_construction_params = 5; |
199 | GParameter param[gwd_settings_storage_gsettings_n_construction_params]; |
200 | |
201 | GValue desktop_value = G_VALUE_INIT; |
202 | GValue metacity_value = G_VALUE_INIT; |
203 | + GValue marco_value = G_VALUE_INIT; |
204 | GValue gwd_value = G_VALUE_INIT; |
205 | GValue writable_value = G_VALUE_INIT; |
206 | |
207 | GWDSettingsStorage *storage = NULL; |
208 | + GWDSettingsStorageGSettingsPrivate *priv; |
209 | |
210 | g_return_val_if_fail (writable != NULL, NULL); |
211 | |
212 | g_value_init (&desktop_value, G_TYPE_OBJECT); |
213 | g_value_init (&metacity_value, G_TYPE_OBJECT); |
214 | + g_value_init (&marco_value, G_TYPE_OBJECT); |
215 | g_value_init (&gwd_value, G_TYPE_OBJECT); |
216 | g_value_init (&writable_value, G_TYPE_POINTER); |
217 | |
218 | g_value_take_object (&desktop_value, desktop); |
219 | g_value_take_object (&metacity_value, metacity); |
220 | + g_value_take_object (&marco_value, marco); |
221 | g_value_take_object (&gwd_value, gwd); |
222 | g_value_set_pointer (&writable_value, writable); |
223 | |
224 | @@ -392,10 +445,12 @@ |
225 | param[0].value = desktop_value; |
226 | param[1].name = "metacity-gsettings"; |
227 | param[1].value = metacity_value; |
228 | - param[2].name = "gwd-gsettings"; |
229 | - param[2].value = gwd_value; |
230 | - param[3].name = "writable-settings"; |
231 | - param[3].value = writable_value; |
232 | + param[2].name = "marco-gsettings"; |
233 | + param[2].value = marco_value; |
234 | + param[3].name = "gwd-gsettings"; |
235 | + param[3].value = gwd_value; |
236 | + param[4].name = "writable-settings"; |
237 | + param[4].value = writable_value; |
238 | |
239 | storage = GWD_SETTINGS_STORAGE_INTERFACE (g_object_newv (GWD_TYPE_SETTINGS_STORAGE_GSETTINGS, |
240 | gwd_settings_storage_gsettings_n_construction_params, |
241 | @@ -403,9 +458,33 @@ |
242 | |
243 | g_value_unset (&desktop_value); |
244 | g_value_unset (&metacity_value); |
245 | + g_value_unset (&marco_value); |
246 | g_value_unset (&gwd_value); |
247 | g_value_unset (&writable_value); |
248 | |
249 | + priv = GET_PRIVATE (storage); |
250 | + priv->is_mate_desktop = FALSE; |
251 | + |
252 | + if (marco) { |
253 | + const gchar *xdg_current_desktop; |
254 | + |
255 | + xdg_current_desktop = g_getenv ("XDG_CURRENT_DESKTOP"); |
256 | + if (xdg_current_desktop) { |
257 | + gchar **desktops; |
258 | + gint i; |
259 | + |
260 | + desktops = g_strsplit (xdg_current_desktop, ":", -1); |
261 | + for (i = 0; desktops[i] != NULL; i++) { |
262 | + if (g_strcmp0 (desktops[i], "MATE") == 0) { |
263 | + priv->is_mate_desktop = TRUE; |
264 | + break; |
265 | + } |
266 | + } |
267 | + |
268 | + g_strfreev (desktops); |
269 | + } |
270 | + } |
271 | + |
272 | return storage; |
273 | } |
274 | |
275 | @@ -528,3 +607,43 @@ |
276 | { |
277 | return get_settings_no_abort (ORG_GNOME_DESKTOP_WM_PREFERENCES); |
278 | } |
279 | + |
280 | +static void |
281 | +org_mate_marco_general_settings_changed (GSettings *settings, |
282 | + const gchar *key, |
283 | + gpointer user_data) |
284 | +{ |
285 | + GWDSettingsStorage *storage; |
286 | + |
287 | + storage = GWD_SETTINGS_STORAGE_INTERFACE (user_data); |
288 | + |
289 | + if (strcmp (key, ORG_MATE_MARCO_GENERAL_TITLEBAR_USES_SYSTEM_FONT) == 0 || |
290 | + strcmp (key, ORG_MATE_MARCO_GENERAL_TITLEBAR_FONT) == 0) |
291 | + gwd_settings_storage_update_font (storage); |
292 | + else if (strcmp (key, ORG_MATE_MARCO_GENERAL_TITLEBAR_FONT) == 0) |
293 | + gwd_settings_storage_update_font (storage); |
294 | + else if (strcmp (key, ORG_MATE_MARCO_GENERAL_ACTION_DOUBLE_CLICK_TITLEBAR) == 0 || |
295 | + strcmp (key, ORG_MATE_MARCO_GENERAL_ACTION_MIDDLE_CLICK_TITLEBAR) == 0 || |
296 | + strcmp (key, ORG_MATE_MARCO_GENERAL_ACTION_RIGHT_CLICK_TITLEBAR) == 0) |
297 | + gwd_settings_storage_update_titlebar_actions (storage); |
298 | + else if (strcmp (key, ORG_MATE_MARCO_GENERAL_THEME) == 0) |
299 | + gwd_settings_storage_update_metacity_theme (storage); |
300 | + else if (strcmp (key, ORG_MATE_MARCO_GENERAL_BUTTON_LAYOUT) == 0) |
301 | + gwd_settings_storage_update_button_layout (storage); |
302 | +} |
303 | + |
304 | +void |
305 | +gwd_connect_org_mate_marco_general_settings (GSettings *settings, |
306 | + GWDSettingsStorage *storage) |
307 | +{ |
308 | + if (!settings) |
309 | + return; |
310 | + |
311 | + g_signal_connect (settings, "changed", (GCallback) org_mate_marco_general_settings_changed, storage); |
312 | +} |
313 | + |
314 | +GSettings * |
315 | +gwd_get_org_mate_marco_general_settings () |
316 | +{ |
317 | + return get_settings_no_abort (ORG_MATE_MARCO_GENERAL); |
318 | +} |
319 | |
320 | === modified file 'gtk/window-decorator/gwd-settings-storage-gsettings.h' |
321 | --- gtk/window-decorator/gwd-settings-storage-gsettings.h 2016-02-22 12:27:13 +0000 |
322 | +++ gtk/window-decorator/gwd-settings-storage-gsettings.h 2016-03-15 13:00:32 +0000 |
323 | @@ -31,6 +31,7 @@ |
324 | GWDSettingsStorage * |
325 | gwd_settings_storage_gsettings_new (GSettings *orgGNOMEDesktopSettings, |
326 | GSettings *metacitySettings, |
327 | + GSettings *marcoSettings, |
328 | GSettings *gwdSettings, |
329 | GWDSettingsWritable *writableSettings); |
330 | |
331 | @@ -55,9 +56,17 @@ |
332 | GSettings * |
333 | gwd_get_org_gnome_desktop_wm_preferences_settings (); |
334 | |
335 | +void |
336 | +gwd_connect_org_mate_marco_general_settings (GSettings *settings, |
337 | + GWDSettingsStorage *storage); |
338 | + |
339 | +GSettings * |
340 | +gwd_get_org_mate_marco_general_settings (); |
341 | + |
342 | extern const gchar * ORG_COMPIZ_GWD; |
343 | extern const gchar * ORG_GNOME_METACITY; |
344 | extern const gchar * ORG_GNOME_DESKTOP_WM_PREFERENCES; |
345 | +extern const gchar * ORG_MATE_MARCO_GENERAL; |
346 | |
347 | extern const gchar * ORG_COMPIZ_GWD_KEY_USE_TOOLTIPS; |
348 | extern const gchar * ORG_COMPIZ_GWD_KEY_BLUR_TYPE; |
349 | @@ -75,6 +84,13 @@ |
350 | extern const gchar * ORG_GNOME_DESKTOP_WM_PREFERENCES_TITLEBAR_USES_SYSTEM_FONT; |
351 | extern const gchar * ORG_GNOME_DESKTOP_WM_PREFERENCES_TITLEBAR_FONT; |
352 | extern const gchar * ORG_GNOME_DESKTOP_WM_PREFERENCES_BUTTON_LAYOUT; |
353 | +extern const gchar * ORG_MATE_MARCO_GENERAL_ACTION_DOUBLE_CLICK_TITLEBAR; |
354 | +extern const gchar * ORG_MATE_MARCO_GENERAL_ACTION_MIDDLE_CLICK_TITLEBAR; |
355 | +extern const gchar * ORG_MATE_MARCO_GENERAL_ACTION_RIGHT_CLICK_TITLEBAR; |
356 | +extern const gchar * ORG_MATE_MARCO_GENERAL_THEME; |
357 | +extern const gchar * ORG_MATE_MARCO_GENERAL_TITLEBAR_USES_SYSTEM_FONT; |
358 | +extern const gchar * ORG_MATE_MARCO_GENERAL_TITLEBAR_FONT; |
359 | +extern const gchar * ORG_MATE_MARCO_GENERAL_BUTTON_LAYOUT; |
360 | |
361 | G_END_DECLS |
362 | |
363 | |
364 | === modified file 'gtk/window-decorator/settings.c' |
365 | --- gtk/window-decorator/settings.c 2016-03-11 08:26:25 +0000 |
366 | +++ gtk/window-decorator/settings.c 2016-03-15 13:00:32 +0000 |
367 | @@ -41,12 +41,14 @@ |
368 | GSettings *compiz = gwd_get_org_compiz_gwd_settings (); |
369 | GSettings *metacity = gwd_get_org_gnome_metacity_settings (); |
370 | GSettings *gnome = gwd_get_org_gnome_desktop_wm_preferences_settings (); |
371 | + GSettings *marco = gwd_get_org_mate_marco_general_settings (); |
372 | |
373 | - storage = gwd_settings_storage_gsettings_new (gnome, metacity, compiz, writable); |
374 | + storage = gwd_settings_storage_gsettings_new (gnome, metacity, marco, compiz, writable); |
375 | |
376 | gwd_connect_org_compiz_gwd_settings (compiz, storage); |
377 | gwd_connect_org_gnome_metacity_settings (metacity, storage); |
378 | gwd_connect_org_gnome_desktop_wm_preferences_settings (gnome, storage); |
379 | + gwd_connect_org_mate_marco_general_settings (marco, storage); |
380 | #endif |
381 | |
382 | xprop_storage = gwd_settings_xproperty_storage_new (writable); |
383 | |
384 | === modified file 'gtk/window-decorator/tests/CMakeLists.txt' |
385 | --- gtk/window-decorator/tests/CMakeLists.txt 2016-02-22 12:27:13 +0000 |
386 | +++ gtk/window-decorator/tests/CMakeLists.txt 2016-03-15 13:00:32 +0000 |
387 | @@ -90,6 +90,21 @@ |
388 | |
389 | add_gsettings_schema_to_recompilation_list (compiz_gwd_gsettings_org_gnome_metacity_schema) |
390 | |
391 | + set (_marco_gschema_name org.mate.marco) |
392 | + set (_marco_gschema_filename ${_marco_gschema_name}.gschema.xml) |
393 | + set (_marco_gschema_filepath ${CMAKE_CURRENT_SOURCE_DIR}/${_marco_gschema_filename}) |
394 | + set (_marco_gschema_generated_location ${CMAKE_BINARY_DIR}/generated/glib-2.0/schemas/${_marco_gschema_filename}) |
395 | + |
396 | + add_custom_command (OUTPUT ${_marco_gschema_generated_location} |
397 | + COMMAND cp -r ${_marco_gschema_filepath} ${_marco_gschema_generated_location} |
398 | + DEPENDS ${_marco_gschema_filepath} |
399 | + VERBATIM) |
400 | + |
401 | + add_custom_target (compiz_gwd_gsettings_org_mate_marco_schema ALL |
402 | + DEPENDS ${_marco_gschema_generated_location}) |
403 | + |
404 | + add_gsettings_schema_to_recompilation_list (compiz_gwd_gsettings_org_nate_marco_schema) |
405 | + |
406 | set (COMPIZ_TEST_GWD_SETTINGS_ADDITIONAL_LIBRARIES |
407 | ${COMPIZ_TEST_GWD_SETTINGS_ADDITIONAL_LIBRARIES} |
408 | gtk_window_decorator_settings_storage_gsettings) |
409 | |
410 | === added file 'gtk/window-decorator/tests/org.mate.marco.gschema.xml' |
411 | --- gtk/window-decorator/tests/org.mate.marco.gschema.xml 1970-01-01 00:00:00 +0000 |
412 | +++ gtk/window-decorator/tests/org.mate.marco.gschema.xml 2016-03-15 13:00:32 +0000 |
413 | @@ -0,0 +1,53 @@ |
414 | +<schemalist> |
415 | + <enum id="org.mate.Marco.ActionTitlebar"> |
416 | + <value nick="toggle_shade" value="0"/> |
417 | + <value nick="toggle_maximize" value="1"/> |
418 | + <value nick="toggle_maximize_horizontally" value="2"/> |
419 | + <value nick="toggle_maximize_vertically" value="3"/> |
420 | + <value nick="minimize" value="4"/> |
421 | + <value nick="none" value="5"/> |
422 | + <value nick="lower" value="6"/> |
423 | + <value nick="menu" value="7"/> |
424 | + <value nick="last" value="8"/> |
425 | + </enum> |
426 | + <schema id="org.mate.Marco" path="/org/mate/marco/"> |
427 | + <child name="general" schema="org.mate.Marco.general"/> |
428 | + </schema> |
429 | + <schema id="org.mate.Marco.general" path="/org/mate/marco/general/"> |
430 | + <key name="button-layout" type="s"> |
431 | + <default>'menu:minimize,maximize,close'</default> |
432 | + <summary>Arrangement of buttons on the titlebar</summary> |
433 | + <description>Arrangement of buttons on the titlebar. The value should be a string, such as "menu:minimize,maximize,spacer,close"; the colon separates the left corner of the window from the right corner, and the button names are comma-separated. Duplicate buttons are not allowed. Unknown button names are silently ignored so that buttons can be added in future marco versions without breaking older versions. A special spacer tag can be used to insert some space between two adjacent buttons.</description> |
434 | + </key> |
435 | + <key name="action-double-click-titlebar" enum="org.mate.Marco.ActionTitlebar"> |
436 | + <default>'toggle_maximize'</default> |
437 | + <summary>Action on title bar double-click</summary> |
438 | + <description>This option determines the effects of double-clicking on the title bar. Current valid options are 'toggle_shade', which will shade/unshade the window, 'toggle_maximize' which will maximize/unmaximize the window, 'toggle_maximize_horizontally' and 'toggle_maximize_vertically' which will maximize/unmaximize the window in that direction only, 'minimize' which will minimize the window, 'shade' which will roll the window up, 'menu' which will display the window menu, 'lower' which will put the window behind all the others, and 'none' which will not do anything.</description> |
439 | + </key> |
440 | + <key name="action-middle-click-titlebar" enum="org.mate.Marco.ActionTitlebar"> |
441 | + <default>'lower'</default> |
442 | + <summary>Action on title bar middle-click</summary> |
443 | + <description>This option determines the effects of middle-clicking on the title bar. Current valid options are 'toggle_shade', which will shade/unshade the window, 'toggle_maximize' which will maximize/unmaximize the window, 'toggle_maximize_horizontally' and 'toggle_maximize_vertically' which will maximize/unmaximize the window in that direction only, 'minimize' which will minimize the window, 'shade' which will roll the window up, 'menu' which will display the window menu, 'lower' which will put the window behind all the others, and 'none' which will not do anything.</description> |
444 | + </key> |
445 | + <key name="action-right-click-titlebar" enum="org.mate.Marco.ActionTitlebar"> |
446 | + <default>'menu'</default> |
447 | + <summary>Action on title bar right-click</summary> |
448 | + <description>This option determines the effects of right-clicking on the title bar. Current valid options are 'toggle_shade', which will shade/unshade the window, 'toggle_maximize' which will maximize/unmaximize the window, 'toggle_maximize_horizontally' and 'toggle_maximize_vertically' which will maximize/unmaximize the window in that direction only, 'minimize' which will minimize the window, 'shade' which will roll the window up, 'menu' which will display the window menu, 'lower' which will put the window behind all the others, and 'none' which will not do anything.</description> |
449 | + </key> |
450 | + <key name="theme" type="s"> |
451 | + <default>'Menta'</default> |
452 | + <summary>Current theme</summary> |
453 | + <description>The theme determines the appearance of window borders, titlebar, and so forth.</description> |
454 | + </key> |
455 | + <key name="titlebar-uses-system-font" type="b"> |
456 | + <default>false</default> |
457 | + <summary>Use standard system font in window titles</summary> |
458 | + <description>If true, ignore the titlebar_font option, and use the standard application font for window titles.</description> |
459 | + </key> |
460 | + <key name="titlebar-font" type="s"> |
461 | + <default>'Sans Bold 10'</default> |
462 | + <summary>Window title font</summary> |
463 | + <description>A font description string describing a font for window titlebars. The size from the description will only be used if the titlebar_font_size option is set to 0. Also, this option is disabled if the titlebar_uses_desktop_font option is set to true.</description> |
464 | + </key> |
465 | + </schema> |
466 | +</schemalist> |
467 | |
468 | === modified file 'gtk/window-decorator/tests/test_gwd_settings.cpp' |
469 | --- gtk/window-decorator/tests/test_gwd_settings.cpp 2016-02-22 12:27:13 +0000 |
470 | +++ gtk/window-decorator/tests/test_gwd_settings.cpp 2016-03-15 13:00:32 +0000 |
471 | @@ -1429,6 +1429,7 @@ |
472 | gwd_connect_org_compiz_gwd_settings (NULL, mStorage.get ()); |
473 | gwd_connect_org_gnome_metacity_settings (NULL, mStorage.get ()); |
474 | gwd_connect_org_gnome_desktop_wm_preferences_settings (NULL, mStorage.get ()); |
475 | + gwd_connect_org_mate_marco_settings (NULL, mStorage.get ()); |
476 | |
477 | EXPECT_CALL (*mStorageMock, dispose ()); |
478 | EXPECT_CALL (*mStorageMock, finalize ()); |
479 | @@ -1448,9 +1449,11 @@ |
480 | mGWDSettings = gwd_get_org_compiz_gwd_settings (); |
481 | mMetacitySettings = gwd_get_org_gnome_metacity_settings (); |
482 | mDesktopSettings = gwd_get_org_gnome_desktop_wm_preferences_settings (); |
483 | + mMarcoSettings = gwd_get_org_mate_marco_settings (); |
484 | |
485 | mStorage.reset (gwd_settings_storage_gsettings_new (mDesktopSettings, |
486 | mMetacitySettings, |
487 | + mMarcoSettings, |
488 | mGWDSettings, |
489 | writable), |
490 | boost::bind (gwd_settings_storage_unref, _1)); |
491 | @@ -1487,6 +1490,7 @@ |
492 | { |
493 | g_settings_set_boolean (mGWDSettings, ORG_COMPIZ_GWD_KEY_USE_METACITY_THEME, useMetacityTheme); |
494 | g_settings_set_string (mDesktopSettings, ORG_GNOME_DESKTOP_WM_PREFERENCES_THEME, metacityTheme.c_str ()); |
495 | + g_settings_set_string (mMarcoSettings, ORG_MATE_MARCO_GENERAL_THEME, metacityTheme.c_str ()); |
496 | } |
497 | |
498 | virtual void SetButtonLayout (const std::string &buttonLayout) |
499 | @@ -1494,6 +1498,9 @@ |
500 | g_settings_set_string (mDesktopSettings, |
501 | ORG_GNOME_DESKTOP_WM_PREFERENCES_BUTTON_LAYOUT, |
502 | buttonLayout.c_str ()); |
503 | + g_settings_set_string (mMarcoSettings, |
504 | + ORG_MATE_MARCO_GENERAL_BUTTON_LAYOUT, |
505 | + buttonLayout.c_str ()); |
506 | } |
507 | |
508 | virtual void SetFont (gboolean useSystemFont, const std::string &titlebarFont) |
509 | @@ -1504,6 +1511,12 @@ |
510 | g_settings_set_string (mDesktopSettings, |
511 | ORG_GNOME_DESKTOP_WM_PREFERENCES_TITLEBAR_FONT, |
512 | titlebarFont.c_str ()); |
513 | + g_settings_set_boolean (mMarcoSettings, |
514 | + ORG_MATE_MARCO_GENERAL_TITLEBAR_USES_SYSTEM_FONT, |
515 | + useSystemFont); |
516 | + g_settings_set_string (mMarcoSettings, |
517 | + ORG_MATE_MARCO_GENERAL_TITLEBAR_FONT, |
518 | + titlebarFont.c_str ()); |
519 | } |
520 | |
521 | virtual void SetTitlebarActions (const std::string &doubleClickAction, |
522 | @@ -1528,6 +1541,15 @@ |
523 | g_settings_set_string (mDesktopSettings, |
524 | ORG_GNOME_DESKTOP_WM_PREFERENCES_ACTION_RIGHT_CLICK_TITLEBAR, |
525 | translatedRC.c_str ()); |
526 | + g_settings_set_string (mMarcoSettings, |
527 | + ORG_MATE_MARCO_GENERAL_ACTION_DOUBLE_CLICK_TITLEBAR, |
528 | + translatedDC.c_str ()); |
529 | + g_settings_set_string (mMarcoSettings, |
530 | + ORG_MATE_MARCO_GENERAL_ACTION_MIDDLE_CLICK_TITLEBAR, |
531 | + translatedMC.c_str ()); |
532 | + g_settings_set_string (mMarcoSettings, |
533 | + ORG_MATE_MARCO_GENERAL_ACTION_RIGHT_CLICK_TITLEBAR, |
534 | + translatedRC.c_str ()); |
535 | g_settings_set_string (mGWDSettings, |
536 | ORG_COMPIZ_GWD_KEY_MOUSE_WHEEL_ACTION, |
537 | mouseWheelAction.c_str ()); |
538 | @@ -1539,6 +1561,7 @@ |
539 | mGWDSettings = NULL; |
540 | mMetacitySettings = NULL; |
541 | mDesktopSettings = NULL; |
542 | + mMarcoSettings = NULL; |
543 | gsettingsEnv.TearDownEnv (); |
544 | gsliceEnv.TearDownEnv (); |
545 | } |
546 | @@ -1548,6 +1571,7 @@ |
547 | GSettings *mGWDSettings; |
548 | GSettings *mMetacitySettings; |
549 | GSettings *mDesktopSettings; |
550 | + GSettings *mMarcoSettings; |
551 | boost::shared_ptr <GWDSettingsStorage> mStorage; |
552 | CompizGLibGSliceOffEnv gsliceEnv; |
553 | CompizGLibGSettingsMemoryBackendTestingEnv gsettingsEnv; |
+1