Merge lp:~muktupavels/compiz/gwd-improve-settings-storage into lp:compiz/0.9.12

Proposed by Alberts Muktupāvels
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: 4053
Merged at revision: 4048
Proposed branch: lp:~muktupavels/compiz/gwd-improve-settings-storage
Merge into: lp:compiz/0.9.12
Prerequisite: lp:~muktupavels/compiz/gwd-meta-theme-get-title-scale-removed
Diff against target: 619 lines (+147/-275)
8 files modified
gtk/window-decorator/gwd-settings-storage.c (+145/-60)
gtk/window-decorator/gwd-settings-storage.h (+2/-0)
gtk/window-decorator/tests/CMakeLists.txt (+0/-48)
gtk/window-decorator/tests/compiz_gwd_tests.h.in (+0/-31)
gtk/window-decorator/tests/org.gnome.desktop.wm.preferences.gschema.xml (+0/-72)
gtk/window-decorator/tests/org.gnome.metacity.gschema.xml (+0/-10)
gtk/window-decorator/tests/org.mate.marco.gschema.xml (+0/-53)
gtk/window-decorator/tests/test_gwd_settings.cpp (+0/-1)
To merge this branch: bzr merge lp:~muktupavels/compiz/gwd-improve-settings-storage
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve
Review via email: mp+296207@code.launchpad.net

Commit message

gtk-window-decorator: improve GWDSettingsStorage

- Remove unused GSettings schemas from tests.
- If gtk-window-decorator is used with GNOME session other than GNOME-Flashback then use theme from org.gnome.desktop.wm.preferences schema.
- Don't create GSettings objects for schemas that is not needed in current desktop.

Description of the change

- Remove unused GSettings schemas from tests.
- If gtk-window-decorator is used with GNOME session other than GNOME-Flashback then use theme from org.gnome.desktop.wm.preferences schema.
- Don't create GSettings objects for schemas that is not needed in current desktop.

To post a comment you must log in.
Revision history for this message
Sam Spilsbury (smspillaz) :
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

Have some minor nits and questions

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Good one

review: Approve
Revision history for this message
Alberts Muktupāvels (muktupavels) :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'gtk/window-decorator/gwd-settings-storage.c'
--- gtk/window-decorator/gwd-settings-storage.c 2016-05-21 10:36:31 +0000
+++ gtk/window-decorator/gwd-settings-storage.c 2016-06-01 13:36:56 +0000
@@ -1,3 +1,5 @@
1/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 4 -*- */
2
1/*3/*
2 * Copyright © 2012 Canonical Ltd4 * Copyright © 2012 Canonical Ltd
3 *5 *
@@ -18,16 +20,18 @@
18 * Authored By: Sam Spilsbury <sam.spilsbury@canonical.com>20 * Authored By: Sam Spilsbury <sam.spilsbury@canonical.com>
19 */21 */
2022
21#include <glib-object.h>23#include "config.h"
22#include <glib.h>24
2325#include <gtk/gtk.h>
24#include <gio/gio.h>
25
26#include <string.h>
2726
28#include "gwd-settings.h"27#include "gwd-settings.h"
29#include "gwd-settings-storage.h"28#include "gwd-settings-storage.h"
3029
30static const gchar * ORG_COMPIZ_GWD = "org.compiz.gwd";
31static const gchar * ORG_GNOME_DESKTOP_WM_PREFERENCES = "org.gnome.desktop.wm.preferences";
32static const gchar * ORG_GNOME_METACITY = "org.gnome.metacity";
33static const gchar * ORG_MATE_MARCO_GENERAL = "org.mate.Marco.general";
34
31static const gchar * ORG_COMPIZ_GWD_KEY_USE_TOOLTIPS = "use-tooltips";35static const gchar * ORG_COMPIZ_GWD_KEY_USE_TOOLTIPS = "use-tooltips";
32static const gchar * ORG_COMPIZ_GWD_KEY_BLUR_TYPE = "blur-type";36static const gchar * ORG_COMPIZ_GWD_KEY_BLUR_TYPE = "blur-type";
33static const gchar * ORG_COMPIZ_GWD_KEY_METACITY_THEME_ACTIVE_OPACITY = "metacity-theme-active-opacity";37static const gchar * ORG_COMPIZ_GWD_KEY_METACITY_THEME_ACTIVE_OPACITY = "metacity-theme-active-opacity";
@@ -55,18 +59,27 @@
55static const gchar * ORG_MATE_MARCO_GENERAL_TITLEBAR_FONT = "titlebar-font";59static const gchar * ORG_MATE_MARCO_GENERAL_TITLEBAR_FONT = "titlebar-font";
56static const gchar * ORG_MATE_MARCO_GENERAL_BUTTON_LAYOUT = "button-layout";60static const gchar * ORG_MATE_MARCO_GENERAL_BUTTON_LAYOUT = "button-layout";
5761
62typedef enum
63{
64 GWD_DESKTOP_GNOME,
65 GWD_DESKTOP_GNOME_FLASHBACK,
66 GWD_DESKTOP_MATE
67} GWDDesktop;
68
58struct _GWDSettingsStorage69struct _GWDSettingsStorage
59{70{
60 GObject parent;71 GObject parent;
6172
62 GWDSettings *settings;73 GWDSettings *settings;
6374
75 GWDDesktop current_desktop;
76
64 GSettings *gwd;77 GSettings *gwd;
65 GSettings *desktop;78 GSettings *desktop;
66 GSettings *metacity;79 GSettings *metacity;
67 GSettings *marco;80 GSettings *marco;
6881
69 gboolean is_mate_desktop;82 gulong gtk_decoration_layout_id;
70};83};
7184
72enum85enum
@@ -82,14 +95,48 @@
8295
83G_DEFINE_TYPE (GWDSettingsStorage, gwd_settings_storage, G_TYPE_OBJECT)96G_DEFINE_TYPE (GWDSettingsStorage, gwd_settings_storage, G_TYPE_OBJECT)
8497
98static gchar *
99button_layout_from_gtk_decoration_layout (const gchar *gtk_decoration_layout)
100{
101 gchar **sides = g_strsplit (gtk_decoration_layout, ":", -1);
102 gchar *button_layout;
103 gint i;
104
105 for (i = 0; sides[i]; i++) {
106 gchar **buttons = g_strsplit (sides[i], ",", -1);
107 gint j;
108
109 for (j = 0; buttons[j]; j++) {
110 const gchar *button = NULL;
111
112 if (g_strcmp0 (buttons[j], "icon") == 0)
113 button = "menu";
114 else if (g_strcmp0 (buttons[j], "menu") == 0)
115 button = "appmenu";
116
117 if (button) {
118 g_free (buttons[j]);
119 buttons[j] = g_strdup (button);
120 }
121 }
122
123 g_free (sides[i]);
124 sides[i] = g_strjoinv (",", buttons);
125
126 g_strfreev (buttons);
127 }
128
129 button_layout = g_strjoinv (":", sides);
130 g_strfreev (sides);
131
132 return button_layout;
133}
134
85static inline GSettings *135static inline GSettings *
86get_settings_no_abort (const gchar *schema)136get_settings_no_abort (const gchar *schema)
87{137{
88 GSettingsSchemaSource *source;138 GSettingsSchemaSource *source = g_settings_schema_source_get_default ();
89 GSettings *settings;139 GSettings *settings = NULL;
90
91 source = g_settings_schema_source_get_default ();
92 settings = NULL;
93140
94 if (g_settings_schema_source_lookup (source, schema, TRUE))141 if (g_settings_schema_source_lookup (source, schema, TRUE))
95 settings = g_settings_new (schema);142 settings = g_settings_new (schema);
@@ -145,12 +192,15 @@
145192
146 use_metacity_theme = g_settings_get_boolean (storage->gwd, ORG_COMPIZ_GWD_KEY_USE_METACITY_THEME);193 use_metacity_theme = g_settings_get_boolean (storage->gwd, ORG_COMPIZ_GWD_KEY_USE_METACITY_THEME);
147194
148 if (storage->is_mate_desktop)195 if (storage->current_desktop == GWD_DESKTOP_MATE && storage->marco) {
149 theme = g_settings_get_string (storage->marco, ORG_MATE_MARCO_GENERAL_THEME);196 theme = g_settings_get_string (storage->marco, ORG_MATE_MARCO_GENERAL_THEME);
150 else if (storage->metacity)197 } else if (storage->current_desktop == GWD_DESKTOP_GNOME_FLASHBACK && storage->metacity) {
151 theme = g_settings_get_string (storage->metacity, ORG_GNOME_METACITY_THEME);198 theme = g_settings_get_string (storage->metacity, ORG_GNOME_METACITY_THEME);
152 else199 } else if (storage->desktop) {
200 theme = g_settings_get_string (storage->desktop, ORG_GNOME_DESKTOP_WM_PREFERENCES_THEME);
201 } else {
153 return;202 return;
203 }
154204
155 gwd_settings_metacity_theme_changed (storage->settings, use_metacity_theme, theme);205 gwd_settings_metacity_theme_changed (storage->settings, use_metacity_theme, theme);
156 g_free (theme);206 g_free (theme);
@@ -181,12 +231,21 @@
181{231{
182 gchar *button_layout;232 gchar *button_layout;
183233
184 if (storage->is_mate_desktop)234 if (storage->current_desktop == GWD_DESKTOP_MATE && storage->marco) {
185 button_layout = g_settings_get_string (storage->marco, ORG_MATE_MARCO_GENERAL_BUTTON_LAYOUT);235 button_layout = g_settings_get_string (storage->marco, ORG_MATE_MARCO_GENERAL_BUTTON_LAYOUT);
186 else if (storage->desktop)236 } else if (storage->current_desktop == GWD_DESKTOP_GNOME_FLASHBACK) {
237 GtkSettings *settings = gtk_settings_get_default ();
238 gchar *gtk_decoration_layout = NULL;
239
240 g_object_get (settings, "gtk-decoration-layout", &gtk_decoration_layout, NULL);
241
242 button_layout = button_layout_from_gtk_decoration_layout (gtk_decoration_layout);
243 g_free (gtk_decoration_layout);
244 } else if (storage->desktop) {
187 button_layout = g_settings_get_string (storage->desktop, ORG_GNOME_DESKTOP_WM_PREFERENCES_BUTTON_LAYOUT);245 button_layout = g_settings_get_string (storage->desktop, ORG_GNOME_DESKTOP_WM_PREFERENCES_BUTTON_LAYOUT);
188 else246 } else {
189 return;247 return;
248 }
190249
191 gwd_settings_button_layout_changed (storage->settings, button_layout);250 gwd_settings_button_layout_changed (storage->settings, button_layout);
192 g_free (button_layout);251 g_free (button_layout);
@@ -195,17 +254,18 @@
195void254void
196update_font (GWDSettingsStorage *storage)255update_font (GWDSettingsStorage *storage)
197{256{
257 gboolean titlebar_system_font;
198 gchar *titlebar_font;258 gchar *titlebar_font;
199 gboolean titlebar_system_font;
200259
201 if (storage->is_mate_desktop) {260 if (storage->current_desktop == GWD_DESKTOP_MATE && storage->marco) {
261 titlebar_system_font = g_settings_get_boolean (storage->marco, ORG_MATE_MARCO_GENERAL_TITLEBAR_USES_SYSTEM_FONT);
202 titlebar_font = g_settings_get_string (storage->marco, ORG_MATE_MARCO_GENERAL_TITLEBAR_FONT);262 titlebar_font = g_settings_get_string (storage->marco, ORG_MATE_MARCO_GENERAL_TITLEBAR_FONT);
203 titlebar_system_font = g_settings_get_boolean (storage->marco, ORG_MATE_MARCO_GENERAL_TITLEBAR_USES_SYSTEM_FONT);
204 } else if (storage->desktop) {263 } else if (storage->desktop) {
264 titlebar_system_font = g_settings_get_boolean (storage->desktop, ORG_GNOME_DESKTOP_WM_PREFERENCES_TITLEBAR_USES_SYSTEM_FONT);
205 titlebar_font = g_settings_get_string (storage->desktop, ORG_GNOME_DESKTOP_WM_PREFERENCES_TITLEBAR_FONT);265 titlebar_font = g_settings_get_string (storage->desktop, ORG_GNOME_DESKTOP_WM_PREFERENCES_TITLEBAR_FONT);
206 titlebar_system_font = g_settings_get_boolean (storage->desktop, ORG_GNOME_DESKTOP_WM_PREFERENCES_TITLEBAR_USES_SYSTEM_FONT);266 } else {
207 } else
208 return;267 return;
268 }
209269
210 gwd_settings_font_changed (storage->settings, titlebar_system_font, titlebar_font);270 gwd_settings_font_changed (storage->settings, titlebar_system_font, titlebar_font);
211 g_free (titlebar_font);271 g_free (titlebar_font);
@@ -222,7 +282,7 @@
222 if (!storage->gwd)282 if (!storage->gwd)
223 return;283 return;
224284
225 if (storage->is_mate_desktop) {285 if (storage->current_desktop == GWD_DESKTOP_MATE && storage->marco) {
226 double_click_action = g_settings_get_string (storage->marco, ORG_MATE_MARCO_GENERAL_ACTION_DOUBLE_CLICK_TITLEBAR);286 double_click_action = g_settings_get_string (storage->marco, ORG_MATE_MARCO_GENERAL_ACTION_DOUBLE_CLICK_TITLEBAR);
227 middle_click_action = g_settings_get_string (storage->marco, ORG_MATE_MARCO_GENERAL_ACTION_MIDDLE_CLICK_TITLEBAR);287 middle_click_action = g_settings_get_string (storage->marco, ORG_MATE_MARCO_GENERAL_ACTION_MIDDLE_CLICK_TITLEBAR);
228 right_click_action = g_settings_get_string (storage->marco, ORG_MATE_MARCO_GENERAL_ACTION_RIGHT_CLICK_TITLEBAR);288 right_click_action = g_settings_get_string (storage->marco, ORG_MATE_MARCO_GENERAL_ACTION_RIGHT_CLICK_TITLEBAR);
@@ -230,8 +290,9 @@
230 double_click_action = g_settings_get_string (storage->desktop, ORG_GNOME_DESKTOP_WM_PREFERENCES_ACTION_DOUBLE_CLICK_TITLEBAR);290 double_click_action = g_settings_get_string (storage->desktop, ORG_GNOME_DESKTOP_WM_PREFERENCES_ACTION_DOUBLE_CLICK_TITLEBAR);
231 middle_click_action = g_settings_get_string (storage->desktop, ORG_GNOME_DESKTOP_WM_PREFERENCES_ACTION_MIDDLE_CLICK_TITLEBAR);291 middle_click_action = g_settings_get_string (storage->desktop, ORG_GNOME_DESKTOP_WM_PREFERENCES_ACTION_MIDDLE_CLICK_TITLEBAR);
232 right_click_action = g_settings_get_string (storage->desktop, ORG_GNOME_DESKTOP_WM_PREFERENCES_ACTION_RIGHT_CLICK_TITLEBAR);292 right_click_action = g_settings_get_string (storage->desktop, ORG_GNOME_DESKTOP_WM_PREFERENCES_ACTION_RIGHT_CLICK_TITLEBAR);
233 } else293 } else {
234 return;294 return;
295 }
235296
236 translate_dashes_to_underscores (double_click_action);297 translate_dashes_to_underscores (double_click_action);
237 translate_dashes_to_underscores (middle_click_action);298 translate_dashes_to_underscores (middle_click_action);
@@ -319,11 +380,17 @@
319}380}
320381
321static void382static void
383gtk_decoration_layout_changed (GtkSettings *settings,
384 GParamSpec *pspec,
385 GWDSettingsStorage *storage)
386{
387 update_button_layout (storage);
388}
389
390static void
322gwd_settings_storage_constructed (GObject *object)391gwd_settings_storage_constructed (GObject *object)
323{392{
324 GWDSettingsStorage *storage;393 GWDSettingsStorage *storage = GWD_SETTINGS_STORAGE (object);
325
326 storage = GWD_SETTINGS_STORAGE (object);
327394
328 G_OBJECT_CLASS (gwd_settings_storage_parent_class)->constructed (object);395 G_OBJECT_CLASS (gwd_settings_storage_parent_class)->constructed (object);
329396
@@ -363,9 +430,7 @@
363static void430static void
364gwd_settings_storage_dispose (GObject *object)431gwd_settings_storage_dispose (GObject *object)
365{432{
366 GWDSettingsStorage *storage;433 GWDSettingsStorage *storage = GWD_SETTINGS_STORAGE (object);
367
368 storage = GWD_SETTINGS_STORAGE (object);
369434
370 g_clear_object (&storage->settings);435 g_clear_object (&storage->settings);
371436
@@ -374,6 +439,13 @@
374 g_clear_object (&storage->metacity);439 g_clear_object (&storage->metacity);
375 g_clear_object (&storage->marco);440 g_clear_object (&storage->marco);
376441
442 if (storage->gtk_decoration_layout_id > 0) {
443 GtkSettings *settings = gtk_settings_get_default ();
444
445 g_signal_handler_disconnect (settings, storage->gtk_decoration_layout_id);
446 storage->gtk_decoration_layout_id = 0;
447 }
448
377 G_OBJECT_CLASS (gwd_settings_storage_parent_class)->dispose (object);449 G_OBJECT_CLASS (gwd_settings_storage_parent_class)->dispose (object);
378}450}
379451
@@ -383,9 +455,7 @@
383 const GValue *value,455 const GValue *value,
384 GParamSpec *pspec)456 GParamSpec *pspec)
385{457{
386 GWDSettingsStorage *storage;458 GWDSettingsStorage *storage = GWD_SETTINGS_STORAGE (object);
387
388 storage = GWD_SETTINGS_STORAGE (object);
389459
390 switch (property_id) {460 switch (property_id) {
391 case PROP_SETTINGS:461 case PROP_SETTINGS:
@@ -401,9 +471,7 @@
401static void471static void
402gwd_settings_storage_class_init (GWDSettingsStorageClass *storage_class)472gwd_settings_storage_class_init (GWDSettingsStorageClass *storage_class)
403{473{
404 GObjectClass *object_class;474 GObjectClass *object_class = G_OBJECT_CLASS (storage_class);
405
406 object_class = G_OBJECT_CLASS (storage_class);
407475
408 object_class->constructed = gwd_settings_storage_constructed;476 object_class->constructed = gwd_settings_storage_constructed;
409 object_class->dispose = gwd_settings_storage_dispose;477 object_class->dispose = gwd_settings_storage_dispose;
@@ -422,31 +490,48 @@
422void490void
423gwd_settings_storage_init (GWDSettingsStorage *storage)491gwd_settings_storage_init (GWDSettingsStorage *storage)
424{492{
425 storage->gwd = get_settings_no_abort ("org.compiz.gwd");493 const gchar *xdg_current_desktop = g_getenv ("XDG_CURRENT_DESKTOP");
426 storage->desktop = get_settings_no_abort ("org.gnome.desktop.wm.preferences");494
427 storage->metacity = get_settings_no_abort ("org.gnome.metacity");495 storage->current_desktop = GWD_DESKTOP_GNOME;
428 storage->marco = get_settings_no_abort ("org.mate.Marco.general");496
429497 if (xdg_current_desktop != NULL) {
430 if (storage->marco) {498 gchar **desktops = g_strsplit (xdg_current_desktop, ":", -1);
431 const gchar *xdg_current_desktop;499 gint i;
432500
433 xdg_current_desktop = g_getenv ("XDG_CURRENT_DESKTOP");501 for (i = 0; desktops[i] != NULL; i++) {
434502 if (g_strcmp0 (desktops[i], "GNOME-Flashback") == 0) {
435 if (xdg_current_desktop) {503 storage->current_desktop = GWD_DESKTOP_GNOME_FLASHBACK;
436 gchar **desktops;504 break;
437 gint i;505 } else if (g_strcmp0 (desktops[i], "MATE") == 0) {
438506 storage->current_desktop = GWD_DESKTOP_MATE;
439 desktops = g_strsplit (xdg_current_desktop, ":", -1);507 break;
440
441 for (i = 0; desktops[i] != NULL; i++) {
442 if (g_strcmp0 (desktops[i], "MATE") == 0) {
443 storage->is_mate_desktop = TRUE;
444 break;
445 }
446 }508 }
447
448 g_strfreev (desktops);
449 }509 }
510
511 g_strfreev (desktops);
512 }
513
514 switch (storage->current_desktop) {
515 case GWD_DESKTOP_GNOME_FLASHBACK:
516 storage->gwd = get_settings_no_abort (ORG_COMPIZ_GWD);
517 storage->desktop = get_settings_no_abort (ORG_GNOME_DESKTOP_WM_PREFERENCES);
518 storage->metacity = get_settings_no_abort (ORG_GNOME_METACITY);
519
520 storage->gtk_decoration_layout_id =
521 g_signal_connect (gtk_settings_get_default (), "notify::gtk-decoration-layout",
522 G_CALLBACK (gtk_decoration_layout_changed), storage);
523 break;
524
525 case GWD_DESKTOP_MATE:
526 storage->gwd = get_settings_no_abort (ORG_COMPIZ_GWD);
527 storage->marco = get_settings_no_abort (ORG_MATE_MARCO_GENERAL);
528 break;
529
530 case GWD_DESKTOP_GNOME:
531 default:
532 storage->gwd = get_settings_no_abort (ORG_COMPIZ_GWD);
533 storage->desktop = get_settings_no_abort (ORG_GNOME_DESKTOP_WM_PREFERENCES);
534 break;
450 }535 }
451}536}
452537
453538
=== modified file 'gtk/window-decorator/gwd-settings-storage.h'
--- gtk/window-decorator/gwd-settings-storage.h 2016-05-20 23:30:30 +0000
+++ gtk/window-decorator/gwd-settings-storage.h 2016-06-01 13:36:56 +0000
@@ -1,3 +1,5 @@
1/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 4 -*- */
2
1/*3/*
2 * Copyright © 2012 Canonical Ltd4 * Copyright © 2012 Canonical Ltd
3 *5 *
46
=== modified file 'gtk/window-decorator/tests/CMakeLists.txt'
--- gtk/window-decorator/tests/CMakeLists.txt 2016-05-21 11:06:24 +0000
+++ gtk/window-decorator/tests/CMakeLists.txt 2016-06-01 13:36:56 +0000
@@ -6,9 +6,6 @@
6 ${CMAKE_SOURCE_DIR}/tests/shared6 ${CMAKE_SOURCE_DIR}/tests/shared
7 ${CMAKE_SOURCE_DIR}/tests/shared/glib)7 ${CMAKE_SOURCE_DIR}/tests/shared/glib)
88
9configure_file (${CMAKE_CURRENT_SOURCE_DIR}/compiz_gwd_tests.h.in
10 ${CMAKE_CURRENT_BINARY_DIR}/compiz_gwd_tests.h)
11
12pkg_check_modules (COMPIZ_TEST_GTK_WINDOW_DECORATOR9pkg_check_modules (COMPIZ_TEST_GTK_WINDOW_DECORATOR
13 glib-2.0>=2.2810 glib-2.0>=2.28
14 gio-2.0>=2.25.0)11 gio-2.0>=2.25.0)
@@ -27,51 +24,6 @@
27 set (COMPIZ_TEST_GWD_SETTINGS_COVERAGE_TARGETS24 set (COMPIZ_TEST_GWD_SETTINGS_COVERAGE_TARGETS
28 gtk_window_decorator_settings)25 gtk_window_decorator_settings)
2926
30 set (_desktop_gschema_name org.gnome.desktop.wm.preferences)
31 set (_desktop_gschema_filename ${_desktop_gschema_name}.gschema.xml)
32 set (_desktop_gschema_filepath ${CMAKE_CURRENT_SOURCE_DIR}/${_desktop_gschema_filename})
33 set (_desktop_gschema_generated_location ${CMAKE_BINARY_DIR}/generated/glib-2.0/schemas/${_desktop_gschema_filename})
34
35 add_custom_command (OUTPUT ${_desktop_gschema_generated_location}
36 COMMAND cp -r ${_desktop_gschema_filepath} ${_desktop_gschema_generated_location}
37 DEPENDS ${_desktop_gschema_filepath}
38 VERBATIM)
39
40 add_custom_target (compiz_gwd_gsettings_org_gnome_desktop_wm_preferences_schema ALL
41 DEPENDS ${_desktop_gschema_generated_location})
42
43 add_gsettings_schema_to_recompilation_list (compiz_gwd_gsettings_org_gnome_desktop_wm_preferences_schema)
44
45 set (_metacity_gschema_name org.gnome.metacity)
46 set (_metacity_gschema_filename ${_metacity_gschema_name}.gschema.xml)
47 set (_metacity_gschema_filepath ${CMAKE_CURRENT_SOURCE_DIR}/${_metacity_gschema_filename})
48 set (_metacity_gschema_generated_location ${CMAKE_BINARY_DIR}/generated/glib-2.0/schemas/${_metacity_gschema_filename})
49
50 add_custom_command (OUTPUT ${_metacity_gschema_generated_location}
51 COMMAND cp -r ${_metacity_gschema_filepath} ${_metacity_gschema_generated_location}
52 DEPENDS ${_metacity_gschema_filepath}
53 VERBATIM)
54
55 add_custom_target (compiz_gwd_gsettings_org_gnome_metacity_schema ALL
56 DEPENDS ${_metacity_gschema_generated_location})
57
58 add_gsettings_schema_to_recompilation_list (compiz_gwd_gsettings_org_gnome_metacity_schema)
59
60 set (_marco_gschema_name org.mate.marco)
61 set (_marco_gschema_filename ${_marco_gschema_name}.gschema.xml)
62 set (_marco_gschema_filepath ${CMAKE_CURRENT_SOURCE_DIR}/${_marco_gschema_filename})
63 set (_marco_gschema_generated_location ${CMAKE_BINARY_DIR}/generated/glib-2.0/schemas/${_marco_gschema_filename})
64
65 add_custom_command (OUTPUT ${_marco_gschema_generated_location}
66 COMMAND cp -r ${_marco_gschema_filepath} ${_marco_gschema_generated_location}
67 DEPENDS ${_marco_gschema_filepath}
68 VERBATIM)
69
70 add_custom_target (compiz_gwd_gsettings_org_mate_marco_schema ALL
71 DEPENDS ${_marco_gschema_generated_location})
72
73 add_gsettings_schema_to_recompilation_list (compiz_gwd_gsettings_org_mate_marco_schema)
74
75 set (COMPIZ_TEST_GWD_SETTINGS_ADDITIONAL_LIBRARIES27 set (COMPIZ_TEST_GWD_SETTINGS_ADDITIONAL_LIBRARIES
76 ${COMPIZ_TEST_GWD_SETTINGS_ADDITIONAL_LIBRARIES}28 ${COMPIZ_TEST_GWD_SETTINGS_ADDITIONAL_LIBRARIES}
77 gtk_window_decorator_settings_storage_gsettings)29 gtk_window_decorator_settings_storage_gsettings)
7830
=== removed file 'gtk/window-decorator/tests/compiz_gwd_tests.h.in'
--- gtk/window-decorator/tests/compiz_gwd_tests.h.in 2012-09-06 10:08:25 +0000
+++ gtk/window-decorator/tests/compiz_gwd_tests.h.in 1970-01-01 00:00:00 +0000
@@ -1,31 +0,0 @@
1/*
2 * Copyright © 2012 Canonical Ltd
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 *
18 * Authored By: Sam Spilsbury <sam.spilsbury@canonical.com>
19 */
20#ifndef _COMPIZ_GWD_TESTS_CONFIG_H
21#define _COMPIZ_GWD_TESTS_CONFIG_H
22
23#define MOCK_SCHEMA_PATH "@CMAKE_BINARY_DIR@/generated/glib-2.0/schemas"
24
25namespace
26{
27const std::string MOCK_PATH (MOCK_SCHEMA_PATH);
28}
29
30#endif
31
320
=== removed file 'gtk/window-decorator/tests/org.gnome.desktop.wm.preferences.gschema.xml'
--- gtk/window-decorator/tests/org.gnome.desktop.wm.preferences.gschema.xml 2012-08-22 07:29:26 +0000
+++ gtk/window-decorator/tests/org.gnome.desktop.wm.preferences.gschema.xml 1970-01-01 00:00:00 +0000
@@ -1,72 +0,0 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<schemalist>
3 <enum id='org.gnome.desktop.GDesktopTitlebarAction'>
4 <value nick='toggle-shade' value='0'/>
5 <value nick='toggle-maximize' value='1'/>
6 <value nick='toggle-maximize-horizontally' value='2'/>
7 <value nick='toggle-maximize-vertically' value='3'/>
8 <value nick='minimize' value='4'/>
9 <value nick='none' value='5'/>
10 <value nick='lower' value='6'/>
11 <value nick='menu' value='7'/>
12 </enum>
13 <schema path="/org/gnome/desktop/wm/preferences/" id="org.gnome.desktop.wm.preferences" gettext-domain="gsettings-desktop-schemas">
14 <key type="s" name="button-layout">
15 <default>':minimize,maximize,close'</default>
16 <summary>Arrangement of buttons on the titlebar</summary>
17 <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 metacity versions without breaking older versions. A special spacer tag can be used to insert some space between two adjacent buttons.</description>
18 </key>
19 <key name="action-double-click-titlebar" enum="org.gnome.desktop.GDesktopTitlebarAction">
20 <default>'toggle-maximize'</default>
21 <summary>Action on title bar double-click</summary>
22 <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>
23
24 <aliases>
25 <alias value="toggle_shade" target="toggle-shade"/>
26 <alias value="toggle_maximize" target="toggle-maximize"/>
27 <alias value="toggle_maximize_horizontally" target="toggle-maximize-horizontally"/>
28 <alias value="toggle_maximize_vertically" target="toggle-maximize-vertically"/>
29 </aliases>
30 </key>
31 <key name="action-middle-click-titlebar" enum="org.gnome.desktop.GDesktopTitlebarAction">
32 <default>'lower'</default>
33 <summary>Action on title bar middle-click</summary>
34 <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>
35
36 <aliases>
37 <alias value="toggle_shade" target="toggle-shade"/>
38 <alias value="toggle_maximize" target="toggle-maximize"/>
39 <alias value="toggle_maximize_horizontally" target="toggle-maximize-horizontally"/>
40 <alias value="toggle_maximize_vertically" target="toggle-maximize-vertically"/>
41 </aliases>
42 </key>
43 <key name="action-right-click-titlebar" enum="org.gnome.desktop.GDesktopTitlebarAction">
44 <default>'menu'</default>
45 <summary>Action on title bar right-click</summary>
46 <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>
47
48 <aliases>
49 <alias value="toggle_shade" target="toggle-shade"/>
50 <alias value="toggle_maximize" target="toggle-maximize"/>
51 <alias value="toggle_maximize_horizontally" target="toggle-maximize-horizontally"/>
52 <alias value="toggle_maximize_vertically" target="toggle-maximize-vertically"/>
53 </aliases>
54 </key>
55 <key type="s" name="theme">
56 <default>'Adwaita'</default>
57 <summary>Current theme</summary>
58 <description>The theme determines the appearance of window borders, titlebar, and so forth.</description>
59 </key>
60 <key type="b" name="titlebar-uses-system-font">
61 <default>false</default>
62 <summary>Use standard system font in window titles</summary>
63 <description>If true, ignore the titlebar-font option, and use the standard application font for window titles.</description>
64 </key>
65 <key type="s" name="titlebar-font">
66 <default>'Cantarell Bold 11'</default>
67 <summary>Window title font</summary>
68 <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>
69 </key>
70 </schema>
71
72</schemalist>
730
=== removed file 'gtk/window-decorator/tests/org.gnome.metacity.gschema.xml'
--- gtk/window-decorator/tests/org.gnome.metacity.gschema.xml 2015-04-06 17:34:00 +0000
+++ gtk/window-decorator/tests/org.gnome.metacity.gschema.xml 1970-01-01 00:00:00 +0000
@@ -1,10 +0,0 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<schemalist>
3 <schema path="/org/gnome/metacity/" id="org.gnome.metacity" gettext-domain="@GETTEXT_DOMAIN">
4 <key type="s" name="theme">
5 <default>'Adwaita'</default>
6 <summary>Current theme</summary>
7 <description>The theme determines the appearance of window borders, titlebar, and so forth.</description>
8 </key>
9 </schema>
10</schemalist>
110
=== removed file 'gtk/window-decorator/tests/org.mate.marco.gschema.xml'
--- gtk/window-decorator/tests/org.mate.marco.gschema.xml 2016-03-02 16:42:14 +0000
+++ gtk/window-decorator/tests/org.mate.marco.gschema.xml 1970-01-01 00:00:00 +0000
@@ -1,53 +0,0 @@
1<schemalist>
2 <enum id="org.mate.Marco.ActionTitlebar">
3 <value nick="toggle_shade" value="0"/>
4 <value nick="toggle_maximize" value="1"/>
5 <value nick="toggle_maximize_horizontally" value="2"/>
6 <value nick="toggle_maximize_vertically" value="3"/>
7 <value nick="minimize" value="4"/>
8 <value nick="none" value="5"/>
9 <value nick="lower" value="6"/>
10 <value nick="menu" value="7"/>
11 <value nick="last" value="8"/>
12 </enum>
13 <schema id="org.mate.Marco" path="/org/mate/marco/">
14 <child name="general" schema="org.mate.Marco.general"/>
15 </schema>
16 <schema id="org.mate.Marco.general" path="/org/mate/marco/general/">
17 <key name="button-layout" type="s">
18 <default>'menu:minimize,maximize,close'</default>
19 <summary>Arrangement of buttons on the titlebar</summary>
20 <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>
21 </key>
22 <key name="action-double-click-titlebar" enum="org.mate.Marco.ActionTitlebar">
23 <default>'toggle_maximize'</default>
24 <summary>Action on title bar double-click</summary>
25 <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>
26 </key>
27 <key name="action-middle-click-titlebar" enum="org.mate.Marco.ActionTitlebar">
28 <default>'lower'</default>
29 <summary>Action on title bar middle-click</summary>
30 <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>
31 </key>
32 <key name="action-right-click-titlebar" enum="org.mate.Marco.ActionTitlebar">
33 <default>'menu'</default>
34 <summary>Action on title bar right-click</summary>
35 <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>
36 </key>
37 <key name="theme" type="s">
38 <default>'Menta'</default>
39 <summary>Current theme</summary>
40 <description>The theme determines the appearance of window borders, titlebar, and so forth.</description>
41 </key>
42 <key name="titlebar-uses-system-font" type="b">
43 <default>false</default>
44 <summary>Use standard system font in window titles</summary>
45 <description>If true, ignore the titlebar_font option, and use the standard application font for window titles.</description>
46 </key>
47 <key name="titlebar-font" type="s">
48 <default>'Sans Bold 10'</default>
49 <summary>Window title font</summary>
50 <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>
51 </key>
52 </schema>
53</schemalist>
540
=== modified file 'gtk/window-decorator/tests/test_gwd_settings.cpp'
--- gtk/window-decorator/tests/test_gwd_settings.cpp 2016-05-21 20:34:55 +0000
+++ gtk/window-decorator/tests/test_gwd_settings.cpp 2016-06-01 13:36:56 +0000
@@ -42,7 +42,6 @@
42#include "compiz_gwd_tests.h"42#include "compiz_gwd_tests.h"
4343
44#include "gwd-settings.h"44#include "gwd-settings.h"
45#include "gwd-settings-storage.h"
4645
47using ::testing::Eq;46using ::testing::Eq;
48using ::testing::Action;47using ::testing::Action;

Subscribers

People subscribed via source and target branches