Merge lp:~muktupavels/compiz/gwd-metacity-theme-type-setting into lp:compiz/0.9.12

Proposed by Alberts Muktupāvels
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: 4058
Merged at revision: 4053
Proposed branch: lp:~muktupavels/compiz/gwd-metacity-theme-type-setting
Merge into: lp:compiz/0.9.12
Prerequisite: lp:~muktupavels/compiz/gwd-improve-settings-storage
Diff against target: 575 lines (+104/-102)
9 files modified
gtk/window-decorator/gdk.c (+0/-9)
gtk/window-decorator/gtk-window-decorator.c (+3/-2)
gtk/window-decorator/gtk-window-decorator.h (+0/-3)
gtk/window-decorator/gwd-settings-storage.c (+10/-6)
gtk/window-decorator/gwd-settings.c (+52/-36)
gtk/window-decorator/gwd-settings.h (+10/-5)
gtk/window-decorator/gwd-theme-metacity.c (+18/-31)
gtk/window-decorator/gwd-theme-metacity.h (+0/-2)
gtk/window-decorator/tests/test_gwd_settings.cpp (+11/-8)
To merge this branch: bzr merge lp:~muktupavels/compiz/gwd-metacity-theme-type-setting
Reviewer Review Type Date Requested Status
Sam Spilsbury Approve
Review via email: mp+296256@code.launchpad.net

Commit message

gtk-window-decorator: add new metacity-theme-type setting in GWDSettings.

Add new metacity-theme-type setting. Currently this is unused, but will be used with Metacity 3.20.

Description of the change

Add new metacity-theme-type setting. Currently this is unused, but will be used with Metacity 3.20.

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

Updated.

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'gtk/window-decorator/gdk.c'
2--- gtk/window-decorator/gdk.c 2016-06-02 03:25:46 +0000
3+++ gtk/window-decorator/gdk.c 2016-06-02 03:25:46 +0000
4@@ -21,15 +21,6 @@
5
6 #include "gtk-window-decorator.h"
7
8-GdkWindow *
9-create_gdk_window (Window xframe)
10-{
11- GdkDisplay *display = gdk_display_get_default ();
12- GdkWindow *window = gdk_x11_window_foreign_new_for_display (display, xframe);
13-
14- return window;
15-}
16-
17 cairo_surface_t *
18 create_native_surface_and_wrap (int w,
19 int h,
20
21=== modified file 'gtk/window-decorator/gtk-window-decorator.c'
22--- gtk/window-decorator/gtk-window-decorator.c 2016-06-02 03:25:46 +0000
23+++ gtk/window-decorator/gtk-window-decorator.c 2016-06-02 03:25:46 +0000
24@@ -147,12 +147,13 @@
25
26 static void
27 update_metacity_theme_cb (GWDSettings *settings,
28- const gchar *metacity_theme,
29+ gint metacity_theme_type,
30+ const gchar *metacity_theme_name,
31 gpointer user_data)
32 {
33 GWDThemeType type = GWD_THEME_TYPE_CAIRO;
34
35- if (metacity_theme != NULL)
36+ if (metacity_theme_name != NULL)
37 type = GWD_THEME_TYPE_METACITY;
38
39 g_set_object (&gwd_theme, gwd_theme_new (type, settings));
40
41=== modified file 'gtk/window-decorator/gtk-window-decorator.h'
42--- gtk/window-decorator/gtk-window-decorator.h 2016-06-02 03:25:46 +0000
43+++ gtk/window-decorator/gtk-window-decorator.h 2016-06-02 03:25:46 +0000
44@@ -493,9 +493,6 @@
45
46 /* gdk.c */
47
48-GdkWindow *
49-create_gdk_window (Window xframe);
50-
51 cairo_surface_t *
52 create_surface (int w,
53 int h,
54
55=== modified file 'gtk/window-decorator/gwd-settings-storage.c'
56--- gtk/window-decorator/gwd-settings-storage.c 2016-06-02 03:25:46 +0000
57+++ gtk/window-decorator/gwd-settings-storage.c 2016-06-02 03:25:46 +0000
58@@ -185,25 +185,29 @@
59 update_metacity_theme (GWDSettingsStorage *storage)
60 {
61 gboolean use_metacity_theme;
62- gchar *theme;
63+ gint metacity_theme_type;
64+ gchar *metacity_theme_name;
65
66 if (!storage->gwd)
67 return;
68
69 use_metacity_theme = g_settings_get_boolean (storage->gwd, ORG_COMPIZ_GWD_KEY_USE_METACITY_THEME);
70+ metacity_theme_type = METACITY_THEME_TYPE_DEFAULT;
71
72 if (storage->current_desktop == GWD_DESKTOP_MATE && storage->marco) {
73- theme = g_settings_get_string (storage->marco, ORG_MATE_MARCO_GENERAL_THEME);
74+ metacity_theme_name = g_settings_get_string (storage->marco, ORG_MATE_MARCO_GENERAL_THEME);
75 } else if (storage->current_desktop == GWD_DESKTOP_GNOME_FLASHBACK && storage->metacity) {
76- theme = g_settings_get_string (storage->metacity, ORG_GNOME_METACITY_THEME);
77+ metacity_theme_name = g_settings_get_string (storage->metacity, ORG_GNOME_METACITY_THEME);
78 } else if (storage->desktop) {
79- theme = g_settings_get_string (storage->desktop, ORG_GNOME_DESKTOP_WM_PREFERENCES_THEME);
80+ metacity_theme_name = g_settings_get_string (storage->desktop, ORG_GNOME_DESKTOP_WM_PREFERENCES_THEME);
81 } else {
82 return;
83 }
84
85- gwd_settings_metacity_theme_changed (storage->settings, use_metacity_theme, theme);
86- g_free (theme);
87+ gwd_settings_metacity_theme_changed (storage->settings, use_metacity_theme,
88+ metacity_theme_type, metacity_theme_name);
89+
90+ g_free (metacity_theme_name);
91 }
92
93 void
94
95=== modified file 'gtk/window-decorator/gwd-settings.c'
96--- gtk/window-decorator/gwd-settings.c 2016-05-21 20:34:55 +0000
97+++ gtk/window-decorator/gwd-settings.c 2016-06-02 03:25:46 +0000
98@@ -43,7 +43,8 @@
99
100 const gint BLUR_TYPE_DEFAULT = BLUR_TYPE_NONE;
101
102-const gchar *METACITY_THEME_DEFAULT = "Adwaita";
103+const gchar *METACITY_THEME_NAME_DEFAULT = "Adwaita";
104+const gint METACITY_THEME_TYPE_DEFAULT = -1;
105 const gdouble METACITY_ACTIVE_OPACITY_DEFAULT = 1.0;
106 const gdouble METACITY_INACTIVE_OPACITY_DEFAULT = 0.75;
107 const gboolean METACITY_ACTIVE_SHADE_OPACITY_DEFAULT = TRUE;
108@@ -71,7 +72,8 @@
109 GObject parent;
110
111 gint blur_type;
112- gchar *metacity_theme;
113+ gchar *metacity_theme_name;
114+ gint metacity_theme_type;
115 guint cmdline_opts;
116
117 decor_shadow_options_t active_shadow;
118@@ -97,7 +99,7 @@
119 PROP_0,
120
121 PROP_BLUR_TYPE,
122- PROP_METACITY_THEME,
123+ PROP_METACITY_THEME_NAME,
124 PROP_CMDLINE_OPTIONS,
125
126 LAST_PROP
127@@ -134,8 +136,8 @@
128 static void
129 update_metacity_theme (GWDSettings *settings)
130 {
131- g_signal_emit (settings, settings_signals[UPDATE_METACITY_THEME],
132- 0, settings->metacity_theme);
133+ g_signal_emit (settings, settings_signals[UPDATE_METACITY_THEME], 0,
134+ settings->metacity_theme_type, settings->metacity_theme_name);
135 }
136
137 static void
138@@ -245,7 +247,7 @@
139
140 settings = GWD_SETTINGS (object);
141
142- g_clear_pointer (&settings->metacity_theme, g_free);
143+ g_clear_pointer (&settings->metacity_theme_name, g_free);
144 g_clear_pointer (&settings->metacity_button_layout, g_free);
145 g_clear_pointer (&settings->titlebar_font, g_free);
146
147@@ -271,9 +273,9 @@
148 settings->blur_type = g_value_get_int (value);
149 break;
150
151- case PROP_METACITY_THEME:
152- g_free (settings->metacity_theme);
153- settings->metacity_theme = g_value_dup_string (value);
154+ case PROP_METACITY_THEME_NAME:
155+ g_free (settings->metacity_theme_name);
156+ settings->metacity_theme_name = g_value_dup_string (value);
157 break;
158
159 default:
160@@ -299,11 +301,11 @@
161 BLUR_TYPE_NONE,
162 G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY);
163
164- properties[PROP_METACITY_THEME] =
165- g_param_spec_string ("metacity-theme",
166- "Metacity Theme",
167- "Metacity Theme Setting",
168- METACITY_THEME_DEFAULT,
169+ properties[PROP_METACITY_THEME_NAME] =
170+ g_param_spec_string ("metacity-theme-name",
171+ "Metacity Theme Name",
172+ "Metacity Theme Name",
173+ METACITY_THEME_NAME_DEFAULT,
174 G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY);
175
176 properties[PROP_CMDLINE_OPTIONS] =
177@@ -328,12 +330,14 @@
178 settings_signals[UPDATE_METACITY_THEME] =
179 g_signal_new ("update-metacity-theme",
180 GWD_TYPE_SETTINGS, G_SIGNAL_RUN_LAST,
181- 0, NULL, NULL, NULL, G_TYPE_NONE, 1, G_TYPE_STRING);
182+ 0, NULL, NULL, NULL, G_TYPE_NONE, 2,
183+ G_TYPE_INT, G_TYPE_STRING);
184
185 settings_signals[UPDATE_METACITY_BUTTON_LAYOUT] =
186 g_signal_new ("update-metacity-button-layout",
187 GWD_TYPE_SETTINGS, G_SIGNAL_RUN_LAST,
188- 0, NULL, NULL, NULL, G_TYPE_NONE, 1, G_TYPE_STRING);
189+ 0, NULL, NULL, NULL, G_TYPE_NONE, 1,
190+ G_TYPE_STRING);
191 }
192
193 static void
194@@ -355,7 +359,8 @@
195 settings->inactive_shadow.shadow_color[1] = 0;
196 settings->inactive_shadow.shadow_color[2] = 0;
197 settings->blur_type = BLUR_TYPE_DEFAULT;
198- settings->metacity_theme = g_strdup (METACITY_THEME_DEFAULT);
199+ settings->metacity_theme_name = g_strdup (METACITY_THEME_NAME_DEFAULT);
200+ settings->metacity_theme_type = METACITY_THEME_TYPE_DEFAULT;
201 settings->metacity_active_opacity = METACITY_ACTIVE_OPACITY_DEFAULT;
202 settings->metacity_inactive_opacity = METACITY_INACTIVE_OPACITY_DEFAULT;
203 settings->metacity_active_shade_opacity = METACITY_ACTIVE_SHADE_OPACITY_DEFAULT;
204@@ -378,22 +383,24 @@
205 }
206
207 GWDSettings *
208-gwd_settings_new (gint blur,
209- const gchar *metacity_theme)
210+gwd_settings_new (gint blur_type,
211+ const gchar *metacity_theme_name)
212 {
213- guint cmdline_opts;
214-
215- cmdline_opts = 0;
216-
217- if (blur != BLUR_TYPE_UNSET)
218+ guint cmdline_opts = 0;
219+
220+ if (blur_type != BLUR_TYPE_UNSET)
221 cmdline_opts |= CMDLINE_BLUR;
222+ else
223+ blur_type = BLUR_TYPE_DEFAULT;
224
225- if (metacity_theme != NULL)
226+ if (metacity_theme_name != NULL)
227 cmdline_opts |= CMDLINE_THEME;
228+ else
229+ metacity_theme_name = METACITY_THEME_NAME_DEFAULT;
230
231 return g_object_new (GWD_TYPE_SETTINGS,
232- "blur-type", blur != BLUR_TYPE_UNSET ? blur : BLUR_TYPE_DEFAULT,
233- "metacity-theme", metacity_theme ? metacity_theme : METACITY_THEME_DEFAULT,
234+ "blur-type", blur_type,
235+ "metacity-theme-name", metacity_theme_name,
236 "cmdline-options", cmdline_opts,
237 NULL);
238 }
239@@ -411,9 +418,15 @@
240 }
241
242 const gchar *
243-gwd_settings_get_metacity_theme (GWDSettings *settings)
244-{
245- return settings->metacity_theme;
246+gwd_settings_get_metacity_theme_name (GWDSettings *settings)
247+{
248+ return settings->metacity_theme_name;
249+}
250+
251+gint
252+gwd_settings_get_metacity_theme_type (GWDSettings *settings)
253+{
254+ return settings->metacity_theme_type;
255 }
256
257 const gchar *
258@@ -614,20 +627,23 @@
259 gboolean
260 gwd_settings_metacity_theme_changed (GWDSettings *settings,
261 gboolean use_metacity_theme,
262- const gchar *metacity_theme)
263+ gint metacity_theme_type,
264+ const gchar *metacity_theme_name)
265 {
266 if (settings->cmdline_opts & CMDLINE_THEME)
267 return FALSE;
268
269 if (use_metacity_theme) {
270- if (g_strcmp0 (metacity_theme, settings->metacity_theme) == 0)
271+ if (g_strcmp0 (metacity_theme_name, settings->metacity_theme_name) == 0 &&
272+ metacity_theme_type == settings->metacity_theme_type)
273 return FALSE;
274
275- g_free (settings->metacity_theme);
276- settings->metacity_theme = g_strdup (metacity_theme);
277+ g_free (settings->metacity_theme_name);
278+ settings->metacity_theme_name = g_strdup (metacity_theme_name);
279+ settings->metacity_theme_type = metacity_theme_type;
280 } else {
281- g_free (settings->metacity_theme);
282- settings->metacity_theme = NULL;
283+ g_free (settings->metacity_theme_name);
284+ settings->metacity_theme_name = NULL;
285 }
286
287 append_to_notify_funcs (settings, update_metacity_theme);
288
289=== modified file 'gtk/window-decorator/gwd-settings.h'
290--- gtk/window-decorator/gwd-settings.h 2016-05-21 16:08:47 +0000
291+++ gtk/window-decorator/gwd-settings.h 2016-06-02 03:25:46 +0000
292@@ -69,7 +69,8 @@
293
294 extern const gint BLUR_TYPE_DEFAULT;
295
296-extern const gchar *METACITY_THEME_DEFAULT;
297+extern const gchar *METACITY_THEME_NAME_DEFAULT;
298+extern const gint METACITY_THEME_TYPE_DEFAULT;
299 extern const gdouble METACITY_ACTIVE_OPACITY_DEFAULT;
300 extern const gdouble METACITY_INACTIVE_OPACITY_DEFAULT;
301 extern const gboolean METACITY_ACTIVE_SHADE_OPACITY_DEFAULT;
302@@ -88,8 +89,8 @@
303 G_DECLARE_FINAL_TYPE (GWDSettings, gwd_settings, GWD, SETTINGS, GObject)
304
305 GWDSettings *
306-gwd_settings_new (gint blur,
307- const gchar *metacity_theme);
308+gwd_settings_new (gint blur_type,
309+ const gchar *metacity_theme_name);
310
311 gint
312 gwd_settings_get_blur_type (GWDSettings *settings);
313@@ -98,7 +99,10 @@
314 gwd_settings_get_metacity_button_layout (GWDSettings *settings);
315
316 const gchar *
317-gwd_settings_get_metacity_theme (GWDSettings *settings);
318+gwd_settings_get_metacity_theme_name (GWDSettings *settings);
319+
320+gint
321+gwd_settings_get_metacity_theme_type (GWDSettings *settings);
322
323 const gchar *
324 gwd_settings_get_titlebar_font (GWDSettings *settings);
325@@ -166,7 +170,8 @@
326 gboolean
327 gwd_settings_metacity_theme_changed (GWDSettings *settings,
328 gboolean use_metacity_theme,
329- const gchar *metacity_theme);
330+ gint metacity_theme_type,
331+ const gchar *metacity_theme_name);
332
333 gboolean
334 gwd_settings_opacity_changed (GWDSettings *settings,
335
336=== modified file 'gtk/window-decorator/gwd-theme-metacity.c'
337--- gtk/window-decorator/gwd-theme-metacity.c 2016-06-02 03:25:46 +0000
338+++ gtk/window-decorator/gwd-theme-metacity.c 2016-06-02 03:25:46 +0000
339@@ -27,6 +27,7 @@
340
341 #include "config.h"
342
343+#include <metacity-private/theme.h>
344 #include <metacity-private/theme-parser.h>
345
346 #include "gtk-window-decorator.h"
347@@ -196,7 +197,7 @@
348 new_layout.right_buttons[i++] = f;
349 } else {
350 g_warning ("Ignoring unknown or already-used "
351- "button name \"%s\"", buttons[b]);
352+ "button name \"%s\"", buttons[b]);
353 }
354 }
355
356@@ -598,13 +599,10 @@
357
358 /* Add the invisible grab area padding */
359 {
360- GdkScreen *screen;
361- MetaStyleInfo *style_info;
362+ GdkScreen *screen = gtk_widget_get_screen (d->frame->style_window_rgba);
363+ MetaStyleInfo *style_info = meta_theme_create_style_info (screen, d->gtk_theme_variant);
364 MetaFrameBorders borders;
365
366- screen = gtk_widget_get_screen (d->frame->style_window_rgba);
367- style_info = meta_theme_create_style_info (screen, d->gtk_theme_variant);
368-
369 meta_theme_get_frame_borders (theme, style_info, type,
370 d->frame->text_height,
371 flags, &borders);
372@@ -686,8 +684,8 @@
373 MetaFrameGeometry *fgeom,
374 MetaFrameType frame_type)
375 {
376- GdkScreen *screen;
377- MetaStyleInfo *style_info;
378+ GdkScreen *screen = gtk_widget_get_screen (decor->frame->style_window_rgba);
379+ MetaStyleInfo *style_info = meta_theme_create_style_info (screen, decor->gtk_theme_variant);
380 gint client_width;
381 gint client_height;
382
383@@ -750,9 +748,6 @@
384 else
385 client_height = decor->border_layout.left.y2 - decor->border_layout.left.y1;
386
387- screen = gtk_widget_get_screen (decor->frame->style_window_rgba);
388- style_info = meta_theme_create_style_info (screen, decor->gtk_theme_variant);
389-
390 meta_theme_calc_geometry (metacity->theme, style_info, frame_type,
391 decor->frame->text_height, *flags, client_width,
392 client_height, &metacity->button_layout, fgeom);
393@@ -858,19 +853,19 @@
394 setup_theme (GWDThemeMetacity *metacity)
395 {
396 GWDSettings *settings = gwd_theme_get_settings (GWD_THEME (metacity));
397- const gchar *metacity_theme = gwd_settings_get_metacity_theme (settings);
398+ const gchar *metacity_theme_name = gwd_settings_get_metacity_theme_name (settings);
399 MetaTheme *theme;
400
401 /* metacity_theme can be NULL only in one case - if user has disabled
402 * metacity theme with use-metacity-theme setting. In that case
403 * GWDThemeCairo will be created / should be created.
404 */
405- g_assert (metacity_theme != NULL);
406+ g_assert (metacity_theme_name != NULL);
407
408 /* meta_theme_get_current returns the last good theme, so we will try to
409 * load theme manually to know that theme is 100% valid.
410 */
411- theme = meta_theme_load (metacity_theme, NULL);
412+ theme = meta_theme_load (metacity_theme_name, NULL);
413 if (theme == NULL)
414 return FALSE;
415
416@@ -881,7 +876,7 @@
417 meta_theme_free (theme);
418
419 /* If we are here then we know that this will not fail. */
420- meta_theme_set_current (metacity_theme, TRUE);
421+ meta_theme_set_current (metacity_theme_name, TRUE);
422 metacity->theme = meta_theme_get_current ();
423
424 return TRUE;
425@@ -934,17 +929,18 @@
426 {
427 GWDThemeMetacity *metacity = GWD_THEME_METACITY (theme);
428 GWDSettings *settings = gwd_theme_get_settings (gwd_theme);
429- GdkDisplay *display;
430- GdkScreen *screen;
431- Display *xdisplay;
432+ GdkDisplay *display = gdk_display_get_default ();
433+ Display *xdisplay = gdk_x11_display_get_xdisplay (display);
434+ GdkScreen *screen = gtk_widget_get_screen (decor->frame->style_window_rgba);
435+ MetaStyleInfo *style_info = meta_theme_create_style_info (screen, decor->gtk_theme_variant);
436+ GtkWidget *style_window = decor->frame->style_window_rgba;
437+ GtkStyleContext *context = gtk_widget_get_style_context (style_window);
438 cairo_surface_t *surface;
439 Picture src;
440 MetaButtonState button_states [META_BUTTON_TYPE_LAST];
441 MetaFrameGeometry fgeom;
442 MetaFrameFlags flags;
443 MetaFrameType frame_type;
444- MetaStyleInfo *style_info;
445- GtkStyleContext *context;
446 cairo_t *cr;
447 gint i;
448 Region top_region;
449@@ -954,15 +950,11 @@
450 double alpha;
451 gboolean shade_alpha;
452 MetaFrameStyle *frame_style;
453- GtkWidget *style_window;
454 GdkRGBA bg_rgba;
455
456 if (!decor->surface || !decor->picture)
457 return;
458
459- display = gdk_display_get_default ();
460- xdisplay = gdk_x11_display_get_xdisplay (display);
461-
462 top_region = NULL;
463 bottom_region = NULL;
464 left_region = NULL;
465@@ -979,9 +971,6 @@
466 if (decoration_alpha == 1.0)
467 alpha = 1.0;
468
469- style_window = decor->frame->style_window_rgba;
470- context = gtk_widget_get_style_context (style_window);
471-
472 cr = cairo_create (decor->buffer_surface ? decor->buffer_surface : decor->surface);
473
474 cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
475@@ -1023,16 +1012,14 @@
476 surface = create_surface (fgeom.width, fgeom.height, decor->frame->style_window_rgba);
477
478 cr = cairo_create (surface);
479+
480 gdk_cairo_set_source_rgba (cr, &bg_rgba);
481 cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
482+ cairo_paint (cr);
483
484 src = XRenderCreatePicture (xdisplay, cairo_xlib_surface_get_drawable (surface),
485 xformat_rgba, 0, NULL);
486
487- screen = gtk_widget_get_screen (decor->frame->style_window_rgba);
488- style_info = meta_theme_create_style_info (screen, decor->gtk_theme_variant);
489-
490- cairo_paint (cr);
491 meta_theme_draw_frame (metacity->theme, style_info, cr, frame_type, flags,
492 fgeom.width - fgeom.borders.total.left - fgeom.borders.total.right,
493 fgeom.height - fgeom.borders.total.top - fgeom.borders.total.bottom,
494
495=== modified file 'gtk/window-decorator/gwd-theme-metacity.h'
496--- gtk/window-decorator/gwd-theme-metacity.h 2016-05-26 07:19:33 +0000
497+++ gtk/window-decorator/gwd-theme-metacity.h 2016-06-02 03:25:46 +0000
498@@ -20,8 +20,6 @@
499 #ifndef GWD_THEME_METACITY_H
500 #define GWD_THEME_METACITY_H
501
502-#include <metacity-private/theme.h>
503-
504 #include "gwd-settings.h"
505 #include "gwd-theme.h"
506
507
508=== modified file 'gtk/window-decorator/tests/test_gwd_settings.cpp'
509--- gtk/window-decorator/tests/test_gwd_settings.cpp 2016-06-02 03:25:46 +0000
510+++ gtk/window-decorator/tests/test_gwd_settings.cpp 2016-06-02 03:25:46 +0000
511@@ -39,8 +39,6 @@
512
513 #include <gtest_unspecified_bool_type_matcher.h>
514
515-#include "compiz_gwd_tests.h"
516-
517 #include "gwd-settings.h"
518
519 using ::testing::Eq;
520@@ -166,7 +164,8 @@
521 }
522
523 static void updateMetacityThemeCb (GWDSettings *settings,
524- const gchar *metacity_theme,
525+ gint metacity_theme_type,
526+ const gchar *metacity_theme_name,
527 GWDMockSettingsNotifiedGMock *gmock)
528 {
529 gmock->updateMetacityTheme ();
530@@ -378,9 +377,10 @@
531 EXPECT_CALL (*mGMockNotified, updateDecorations ());
532 EXPECT_TRUE (gwd_settings_metacity_theme_changed (mSettings.get (),
533 testing_values::USE_METACITY_THEME_VALUE,
534+ METACITY_THEME_TYPE_DEFAULT,
535 testing_values::METACITY_THEME_VALUE.c_str ()));
536
537- EXPECT_THAT (gwd_settings_get_metacity_theme (mSettings.get ()),
538+ EXPECT_THAT (gwd_settings_get_metacity_theme_name (mSettings.get ()),
539 IsStringsEqual (testing_values::METACITY_THEME_VALUE.c_str ()));
540 }
541
542@@ -391,9 +391,10 @@
543 EXPECT_CALL (*mGMockNotified, updateMetacityTheme ());
544 EXPECT_CALL (*mGMockNotified, updateDecorations ());
545 EXPECT_TRUE (gwd_settings_metacity_theme_changed (mSettings.get (), FALSE,
546- METACITY_THEME_DEFAULT));
547+ METACITY_THEME_TYPE_DEFAULT,
548+ METACITY_THEME_NAME_DEFAULT));
549
550- EXPECT_THAT (gwd_settings_get_metacity_theme (mSettings.get ()),
551+ EXPECT_THAT (gwd_settings_get_metacity_theme_name (mSettings.get ()),
552 IsStringsEqual (metacityTheme));
553 }
554
555@@ -401,7 +402,8 @@
556 {
557 EXPECT_FALSE (gwd_settings_metacity_theme_changed (mSettings.get (),
558 testing_values::USE_METACITY_THEME_VALUE,
559- METACITY_THEME_DEFAULT));
560+ METACITY_THEME_TYPE_DEFAULT,
561+ METACITY_THEME_NAME_DEFAULT));
562 }
563
564 TEST_F(GWDSettingsTest, TestMetacityThemeSetCommandLine)
565@@ -413,9 +415,10 @@
566
567 EXPECT_FALSE (gwd_settings_metacity_theme_changed (mSettings.get (),
568 testing_values::USE_METACITY_THEME_VALUE,
569+ METACITY_THEME_TYPE_DEFAULT,
570 testing_values::METACITY_THEME_VALUE.c_str ()));
571
572- EXPECT_THAT (gwd_settings_get_metacity_theme (mSettings.get ()),
573+ EXPECT_THAT (gwd_settings_get_metacity_theme_name (mSettings.get ()),
574 IsStringsEqual (metacityTheme));
575 }
576

Subscribers

People subscribed via source and target branches