Merge lp:~muktupavels/compiz/gwd-support-metacity-3-20 into lp:compiz/0.9.12
- gwd-support-metacity-3-20
- Merge into 0.9.12
Proposed by
Alberts Muktupāvels
Status: | Merged |
---|---|
Approved by: | Marco Trevisan (Treviño) |
Approved revision: | 4047 |
Merged at revision: | 4059 |
Proposed branch: | lp:~muktupavels/compiz/gwd-support-metacity-3-20 |
Merge into: | lp:compiz/0.9.12 |
Prerequisite: | lp:~muktupavels/compiz/gwd-improve-metacity |
Diff against target: |
587 lines (+198/-10) 6 files modified
gtk/CMakeLists.txt (+19/-4) gtk/config.h.gtk.in (+3/-0) gtk/window-decorator/gtk-window-decorator.c (+2/-0) gtk/window-decorator/gwd-settings-storage.c (+67/-2) gtk/window-decorator/gwd-theme-metacity.c (+107/-3) gtk/window-decorator/gwd-theme.c (+0/-1) |
To merge this branch: | bzr merge lp:~muktupavels/compiz/gwd-support-metacity-3-20 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Marco Trevisan (Treviño) | Approve | ||
Review via email: mp+296869@code.launchpad.net |
Commit message
gtk-window-
Description of the change
Support Metacity 3.20.
To post a comment you must log in.
- 4046. By Alberts Muktupāvels
-
If MetaThemeType is META_THEME_TYPE_GTK then use system GTK+ theme.
- 4047. By Alberts Muktupāvels
-
Fix build
Revision history for this message
Sam Spilsbury (smspillaz) : | # |
Revision history for this message
Alberts Muktupāvels (muktupavels) wrote : | # |
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'gtk/CMakeLists.txt' | |||
2 | --- gtk/CMakeLists.txt 2015-12-10 16:34:35 +0000 | |||
3 | +++ gtk/CMakeLists.txt 2016-06-09 20:28:29 +0000 | |||
4 | @@ -25,10 +25,25 @@ | |||
5 | 25 | set (CMAKE_REQUIRED_LIBRARIES "") | 25 | set (CMAKE_REQUIRED_LIBRARIES "") |
6 | 26 | 26 | ||
7 | 27 | if (USE_METACITY) | 27 | if (USE_METACITY) |
12 | 28 | pkg_check_modules (METACITY libmetacity-private>=3.16.0) | 28 | pkg_check_modules (LIBMETACITY libmetacity>=3.19.1) |
13 | 29 | if (NOT METACITY_FOUND) | 29 | |
14 | 30 | compiz_set (USE_METACITY 0) | 30 | if (LIBMETACITY_FOUND) |
15 | 31 | endif (NOT METACITY_FOUND) | 31 | compiz_set (HAVE_METACITY_3_20_0 1) |
16 | 32 | |||
17 | 33 | set (METACITY_INCLUDE_DIRS ${LIBMETACITY_INCLUDE_DIRS}) | ||
18 | 34 | set (METACITY_LIBRARIES ${LIBMETACITY_LIBRARIES}) | ||
19 | 35 | else (LIBMETACITY_FOUND) | ||
20 | 36 | pkg_check_modules (LIBMETACITY_PRIVATE libmetacity-private>=3.16.0) | ||
21 | 37 | |||
22 | 38 | if (LIBMETACITY_PRIVATE_FOUND) | ||
23 | 39 | compiz_set (HAVE_METACITY_3_20_0 0) | ||
24 | 40 | |||
25 | 41 | set (METACITY_INCLUDE_DIRS ${LIBMETACITY_PRIVATE_INCLUDE_DIRS}) | ||
26 | 42 | set (METACITY_LIBRARIES ${LIBMETACITY_PRIVATE_LIBRARIES}) | ||
27 | 43 | else (LIBMETACITY_PRIVATE_FOUND) | ||
28 | 44 | compiz_set (USE_METACITY 0) | ||
29 | 45 | endif (LIBMETACITY_PRIVATE_FOUND) | ||
30 | 46 | endif (LIBMETACITY_FOUND) | ||
31 | 32 | endif (USE_METACITY) | 47 | endif (USE_METACITY) |
32 | 33 | 48 | ||
33 | 34 | if (USE_GNOME) | 49 | if (USE_GNOME) |
34 | 35 | 50 | ||
35 | === modified file 'gtk/config.h.gtk.in' | |||
36 | --- gtk/config.h.gtk.in 2015-06-12 18:43:05 +0000 | |||
37 | +++ gtk/config.h.gtk.in 2016-06-09 20:28:29 +0000 | |||
38 | @@ -1,4 +1,7 @@ | |||
39 | 1 | /* Define to 1 if Metacity support is enabled */ | 1 | /* Define to 1 if Metacity support is enabled */ |
40 | 2 | #cmakedefine USE_METACITY 1 | 2 | #cmakedefine USE_METACITY 1 |
41 | 3 | 3 | ||
42 | 4 | /* Define to 1 if Metacity version >= 3.20.0 */ | ||
43 | 5 | #cmakedefine HAVE_METACITY_3_20_0 1 | ||
44 | 6 | |||
45 | 4 | #define GETTEXT_PACKAGE "${GETTEXT_PACKAGE}" | 7 | #define GETTEXT_PACKAGE "${GETTEXT_PACKAGE}" |
46 | 5 | 8 | ||
47 | === modified file 'gtk/window-decorator/gtk-window-decorator.c' | |||
48 | --- gtk/window-decorator/gtk-window-decorator.c 2016-06-09 20:28:29 +0000 | |||
49 | +++ gtk/window-decorator/gtk-window-decorator.c 2016-06-09 20:28:29 +0000 | |||
50 | @@ -152,6 +152,8 @@ | |||
51 | 152 | type = GWD_THEME_TYPE_METACITY; | 152 | type = GWD_THEME_TYPE_METACITY; |
52 | 153 | 153 | ||
53 | 154 | g_set_object (&gwd_theme, gwd_theme_new (type, settings)); | 154 | g_set_object (&gwd_theme, gwd_theme_new (type, settings)); |
54 | 155 | |||
55 | 156 | gwd_theme_update_titlebar_font (gwd_theme); | ||
56 | 155 | } | 157 | } |
57 | 156 | 158 | ||
58 | 157 | int | 159 | int |
59 | 158 | 160 | ||
60 | === modified file 'gtk/window-decorator/gwd-settings-storage.c' | |||
61 | --- gtk/window-decorator/gwd-settings-storage.c 2016-06-09 20:28:29 +0000 | |||
62 | +++ gtk/window-decorator/gwd-settings-storage.c 2016-06-09 20:28:29 +0000 | |||
63 | @@ -24,12 +24,22 @@ | |||
64 | 24 | 24 | ||
65 | 25 | #include <gtk/gtk.h> | 25 | #include <gtk/gtk.h> |
66 | 26 | 26 | ||
67 | 27 | #ifdef HAVE_METACITY_3_20_0 | ||
68 | 28 | #include <libmetacity/meta-theme.h> | ||
69 | 29 | #endif | ||
70 | 30 | |||
71 | 27 | #include "gwd-settings.h" | 31 | #include "gwd-settings.h" |
72 | 28 | #include "gwd-settings-storage.h" | 32 | #include "gwd-settings-storage.h" |
73 | 29 | 33 | ||
74 | 30 | static const gchar * ORG_COMPIZ_GWD = "org.compiz.gwd"; | 34 | static const gchar * ORG_COMPIZ_GWD = "org.compiz.gwd"; |
75 | 31 | static const gchar * ORG_GNOME_DESKTOP_WM_PREFERENCES = "org.gnome.desktop.wm.preferences"; | 35 | static const gchar * ORG_GNOME_DESKTOP_WM_PREFERENCES = "org.gnome.desktop.wm.preferences"; |
76 | 36 | |||
77 | 37 | #ifdef HAVE_METACITY_3_20_0 | ||
78 | 38 | static const gchar * ORG_GNOME_METACITY_THEME = "org.gnome.metacity.theme"; | ||
79 | 39 | #else | ||
80 | 32 | static const gchar * ORG_GNOME_METACITY = "org.gnome.metacity"; | 40 | static const gchar * ORG_GNOME_METACITY = "org.gnome.metacity"; |
81 | 41 | #endif | ||
82 | 42 | |||
83 | 33 | static const gchar * ORG_MATE_MARCO_GENERAL = "org.mate.Marco.general"; | 43 | static const gchar * ORG_MATE_MARCO_GENERAL = "org.mate.Marco.general"; |
84 | 34 | 44 | ||
85 | 35 | static const gchar * ORG_COMPIZ_GWD_KEY_USE_TOOLTIPS = "use-tooltips"; | 45 | static const gchar * ORG_COMPIZ_GWD_KEY_USE_TOOLTIPS = "use-tooltips"; |
86 | @@ -41,7 +51,12 @@ | |||
87 | 41 | static const gchar * ORG_COMPIZ_GWD_KEY_USE_METACITY_THEME = "use-metacity-theme"; | 51 | static const gchar * ORG_COMPIZ_GWD_KEY_USE_METACITY_THEME = "use-metacity-theme"; |
88 | 42 | static const gchar * ORG_COMPIZ_GWD_KEY_MOUSE_WHEEL_ACTION = "mouse-wheel-action"; | 52 | static const gchar * ORG_COMPIZ_GWD_KEY_MOUSE_WHEEL_ACTION = "mouse-wheel-action"; |
89 | 43 | 53 | ||
90 | 54 | #ifdef HAVE_METACITY_3_20_0 | ||
91 | 55 | static const gchar * ORG_GNOME_METACITY_THEME_NAME = "name"; | ||
92 | 56 | static const gchar * ORG_GNOME_METACITY_THEME_TYPE = "type"; | ||
93 | 57 | #else | ||
94 | 44 | static const gchar * ORG_GNOME_METACITY_THEME = "theme"; | 58 | static const gchar * ORG_GNOME_METACITY_THEME = "theme"; |
95 | 59 | #endif | ||
96 | 45 | 60 | ||
97 | 46 | static const gchar * ORG_GNOME_DESKTOP_WM_PREFERENCES_ACTION_DOUBLE_CLICK_TITLEBAR = "action-double-click-titlebar"; | 61 | static const gchar * ORG_GNOME_DESKTOP_WM_PREFERENCES_ACTION_DOUBLE_CLICK_TITLEBAR = "action-double-click-titlebar"; |
98 | 47 | static const gchar * ORG_GNOME_DESKTOP_WM_PREFERENCES_ACTION_MIDDLE_CLICK_TITLEBAR = "action-middle-click-titlebar"; | 62 | static const gchar * ORG_GNOME_DESKTOP_WM_PREFERENCES_ACTION_MIDDLE_CLICK_TITLEBAR = "action-middle-click-titlebar"; |
99 | @@ -80,6 +95,7 @@ | |||
100 | 80 | GSettings *marco; | 95 | GSettings *marco; |
101 | 81 | 96 | ||
102 | 82 | gulong gtk_decoration_layout_id; | 97 | gulong gtk_decoration_layout_id; |
103 | 98 | gulong gtk_theme_name_id; | ||
104 | 83 | }; | 99 | }; |
105 | 84 | 100 | ||
106 | 85 | enum | 101 | enum |
107 | @@ -197,7 +213,17 @@ | |||
108 | 197 | if (storage->current_desktop == GWD_DESKTOP_MATE && storage->marco) { | 213 | if (storage->current_desktop == GWD_DESKTOP_MATE && storage->marco) { |
109 | 198 | metacity_theme_name = g_settings_get_string (storage->marco, ORG_MATE_MARCO_GENERAL_THEME); | 214 | metacity_theme_name = g_settings_get_string (storage->marco, ORG_MATE_MARCO_GENERAL_THEME); |
110 | 199 | } else if (storage->current_desktop == GWD_DESKTOP_GNOME_FLASHBACK && storage->metacity) { | 215 | } else if (storage->current_desktop == GWD_DESKTOP_GNOME_FLASHBACK && storage->metacity) { |
111 | 216 | #ifdef HAVE_METACITY_3_20_0 | ||
112 | 217 | metacity_theme_type = g_settings_get_enum (storage->metacity, ORG_GNOME_METACITY_THEME_TYPE); | ||
113 | 218 | |||
114 | 219 | if (metacity_theme_type == META_THEME_TYPE_GTK) { | ||
115 | 220 | g_object_get (gtk_settings_get_default (), "gtk-theme-name", &metacity_theme_name, NULL); | ||
116 | 221 | } else { | ||
117 | 222 | metacity_theme_name = g_settings_get_string (storage->metacity, ORG_GNOME_METACITY_THEME_NAME); | ||
118 | 223 | } | ||
119 | 224 | #else | ||
120 | 200 | metacity_theme_name = g_settings_get_string (storage->metacity, ORG_GNOME_METACITY_THEME); | 225 | metacity_theme_name = g_settings_get_string (storage->metacity, ORG_GNOME_METACITY_THEME); |
121 | 226 | #endif | ||
122 | 201 | } else if (storage->desktop) { | 227 | } else if (storage->desktop) { |
123 | 202 | metacity_theme_name = g_settings_get_string (storage->desktop, ORG_GNOME_DESKTOP_WM_PREFERENCES_THEME); | 228 | metacity_theme_name = g_settings_get_string (storage->desktop, ORG_GNOME_DESKTOP_WM_PREFERENCES_THEME); |
124 | 203 | } else { | 229 | } else { |
125 | @@ -359,8 +385,14 @@ | |||
126 | 359 | const gchar *key, | 385 | const gchar *key, |
127 | 360 | GWDSettingsStorage *storage) | 386 | GWDSettingsStorage *storage) |
128 | 361 | { | 387 | { |
129 | 388 | #ifdef HAVE_METACITY_3_20_0 | ||
130 | 389 | if (strcmp (key, ORG_GNOME_METACITY_THEME_NAME) == 0 || | ||
131 | 390 | strcmp (key, ORG_GNOME_METACITY_THEME_TYPE) == 0) | ||
132 | 391 | update_metacity_theme (storage); | ||
133 | 392 | #else | ||
134 | 362 | if (strcmp (key, ORG_GNOME_METACITY_THEME) == 0) | 393 | if (strcmp (key, ORG_GNOME_METACITY_THEME) == 0) |
135 | 363 | update_metacity_theme (storage); | 394 | update_metacity_theme (storage); |
136 | 395 | #endif | ||
137 | 364 | } | 396 | } |
138 | 365 | 397 | ||
139 | 366 | static void | 398 | static void |
140 | @@ -391,6 +423,24 @@ | |||
141 | 391 | update_button_layout (storage); | 423 | update_button_layout (storage); |
142 | 392 | } | 424 | } |
143 | 393 | 425 | ||
144 | 426 | #ifdef HAVE_METACITY_3_20_0 | ||
145 | 427 | static void | ||
146 | 428 | gtk_theme_name_changed (GtkSettings *settings, | ||
147 | 429 | GParamSpec *pspec, | ||
148 | 430 | GWDSettingsStorage *storage) | ||
149 | 431 | { | ||
150 | 432 | MetaThemeType type; | ||
151 | 433 | |||
152 | 434 | if (!storage->metacity) | ||
153 | 435 | return; | ||
154 | 436 | |||
155 | 437 | type = g_settings_get_enum (storage->metacity, ORG_GNOME_METACITY_THEME_TYPE); | ||
156 | 438 | |||
157 | 439 | if (type == META_THEME_TYPE_GTK) | ||
158 | 440 | update_metacity_theme (storage); | ||
159 | 441 | } | ||
160 | 442 | #endif | ||
161 | 443 | |||
162 | 394 | static void | 444 | static void |
163 | 395 | gwd_settings_storage_constructed (GObject *object) | 445 | gwd_settings_storage_constructed (GObject *object) |
164 | 396 | { | 446 | { |
165 | @@ -435,6 +485,7 @@ | |||
166 | 435 | gwd_settings_storage_dispose (GObject *object) | 485 | gwd_settings_storage_dispose (GObject *object) |
167 | 436 | { | 486 | { |
168 | 437 | GWDSettingsStorage *storage = GWD_SETTINGS_STORAGE (object); | 487 | GWDSettingsStorage *storage = GWD_SETTINGS_STORAGE (object); |
169 | 488 | GtkSettings *settings = gtk_settings_get_default (); | ||
170 | 438 | 489 | ||
171 | 439 | g_clear_object (&storage->settings); | 490 | g_clear_object (&storage->settings); |
172 | 440 | 491 | ||
173 | @@ -444,12 +495,15 @@ | |||
174 | 444 | g_clear_object (&storage->marco); | 495 | g_clear_object (&storage->marco); |
175 | 445 | 496 | ||
176 | 446 | if (storage->gtk_decoration_layout_id > 0) { | 497 | if (storage->gtk_decoration_layout_id > 0) { |
177 | 447 | GtkSettings *settings = gtk_settings_get_default (); | ||
178 | 448 | |||
179 | 449 | g_signal_handler_disconnect (settings, storage->gtk_decoration_layout_id); | 498 | g_signal_handler_disconnect (settings, storage->gtk_decoration_layout_id); |
180 | 450 | storage->gtk_decoration_layout_id = 0; | 499 | storage->gtk_decoration_layout_id = 0; |
181 | 451 | } | 500 | } |
182 | 452 | 501 | ||
183 | 502 | if (storage->gtk_theme_name_id > 0) { | ||
184 | 503 | g_signal_handler_disconnect (settings, storage->gtk_theme_name_id); | ||
185 | 504 | storage->gtk_theme_name_id = 0; | ||
186 | 505 | } | ||
187 | 506 | |||
188 | 453 | G_OBJECT_CLASS (gwd_settings_storage_parent_class)->dispose (object); | 507 | G_OBJECT_CLASS (gwd_settings_storage_parent_class)->dispose (object); |
189 | 454 | } | 508 | } |
190 | 455 | 509 | ||
191 | @@ -519,11 +573,22 @@ | |||
192 | 519 | case GWD_DESKTOP_GNOME_FLASHBACK: | 573 | case GWD_DESKTOP_GNOME_FLASHBACK: |
193 | 520 | storage->gwd = get_settings_no_abort (ORG_COMPIZ_GWD); | 574 | storage->gwd = get_settings_no_abort (ORG_COMPIZ_GWD); |
194 | 521 | storage->desktop = get_settings_no_abort (ORG_GNOME_DESKTOP_WM_PREFERENCES); | 575 | storage->desktop = get_settings_no_abort (ORG_GNOME_DESKTOP_WM_PREFERENCES); |
195 | 576 | |||
196 | 577 | #ifdef HAVE_METACITY_3_20_0 | ||
197 | 578 | storage->metacity = get_settings_no_abort (ORG_GNOME_METACITY_THEME); | ||
198 | 579 | #else | ||
199 | 522 | storage->metacity = get_settings_no_abort (ORG_GNOME_METACITY); | 580 | storage->metacity = get_settings_no_abort (ORG_GNOME_METACITY); |
200 | 581 | #endif | ||
201 | 523 | 582 | ||
202 | 524 | storage->gtk_decoration_layout_id = | 583 | storage->gtk_decoration_layout_id = |
203 | 525 | g_signal_connect (gtk_settings_get_default (), "notify::gtk-decoration-layout", | 584 | g_signal_connect (gtk_settings_get_default (), "notify::gtk-decoration-layout", |
204 | 526 | G_CALLBACK (gtk_decoration_layout_changed), storage); | 585 | G_CALLBACK (gtk_decoration_layout_changed), storage); |
205 | 586 | |||
206 | 587 | #ifdef HAVE_METACITY_3_20_0 | ||
207 | 588 | storage->gtk_theme_name_id = | ||
208 | 589 | g_signal_connect (gtk_settings_get_default (), "notify::gtk-theme-name", | ||
209 | 590 | G_CALLBACK (gtk_theme_name_changed), storage); | ||
210 | 591 | #endif | ||
211 | 527 | break; | 592 | break; |
212 | 528 | 593 | ||
213 | 529 | case GWD_DESKTOP_MATE: | 594 | case GWD_DESKTOP_MATE: |
214 | 530 | 595 | ||
215 | === modified file 'gtk/window-decorator/gwd-theme-metacity.c' | |||
216 | --- gtk/window-decorator/gwd-theme-metacity.c 2016-06-09 20:28:29 +0000 | |||
217 | +++ gtk/window-decorator/gwd-theme-metacity.c 2016-06-09 20:28:29 +0000 | |||
218 | @@ -27,8 +27,12 @@ | |||
219 | 27 | 27 | ||
220 | 28 | #include "config.h" | 28 | #include "config.h" |
221 | 29 | 29 | ||
222 | 30 | #ifdef HAVE_METACITY_3_20_0 | ||
223 | 31 | #include <libmetacity/meta-theme.h> | ||
224 | 32 | #else | ||
225 | 30 | #include <metacity-private/theme.h> | 33 | #include <metacity-private/theme.h> |
226 | 31 | #include <metacity-private/theme-parser.h> | 34 | #include <metacity-private/theme-parser.h> |
227 | 35 | #endif | ||
228 | 32 | 36 | ||
229 | 33 | #include "gtk-window-decorator.h" | 37 | #include "gtk-window-decorator.h" |
230 | 34 | #include "gwd-settings.h" | 38 | #include "gwd-settings.h" |
231 | @@ -40,16 +44,21 @@ | |||
232 | 40 | 44 | ||
233 | 41 | MetaTheme *theme; | 45 | MetaTheme *theme; |
234 | 42 | 46 | ||
235 | 47 | #ifndef HAVE_METACITY_3_20_0 | ||
236 | 43 | GHashTable *style_variants; | 48 | GHashTable *style_variants; |
237 | 49 | #endif | ||
238 | 44 | 50 | ||
239 | 45 | gulong button_layout_id; | 51 | gulong button_layout_id; |
240 | 46 | MetaButtonLayout button_layout; | 52 | MetaButtonLayout button_layout; |
241 | 47 | 53 | ||
242 | 54 | #ifndef HAVE_METACITY_3_20_0 | ||
243 | 48 | const PangoFontDescription *titlebar_font; | 55 | const PangoFontDescription *titlebar_font; |
244 | 56 | #endif | ||
245 | 49 | }; | 57 | }; |
246 | 50 | 58 | ||
247 | 51 | G_DEFINE_TYPE (GWDThemeMetacity, gwd_theme_metacity, GWD_TYPE_THEME) | 59 | G_DEFINE_TYPE (GWDThemeMetacity, gwd_theme_metacity, GWD_TYPE_THEME) |
248 | 52 | 60 | ||
249 | 61 | #ifndef HAVE_METACITY_3_20_0 | ||
250 | 53 | static MetaStyleInfo * | 62 | static MetaStyleInfo * |
251 | 54 | get_style_info (GWDThemeMetacity *metacity, | 63 | get_style_info (GWDThemeMetacity *metacity, |
252 | 55 | decor_t *decor) | 64 | decor_t *decor) |
253 | @@ -70,6 +79,7 @@ | |||
254 | 70 | 79 | ||
255 | 71 | return style; | 80 | return style; |
256 | 72 | } | 81 | } |
257 | 82 | #endif | ||
258 | 73 | 83 | ||
259 | 74 | static MetaFrameType | 84 | static MetaFrameType |
260 | 75 | frame_type_from_string (const gchar *str) | 85 | frame_type_from_string (const gchar *str) |
261 | @@ -86,6 +96,7 @@ | |||
262 | 86 | return META_FRAME_TYPE_NORMAL; | 96 | return META_FRAME_TYPE_NORMAL; |
263 | 87 | } | 97 | } |
264 | 88 | 98 | ||
265 | 99 | #ifndef HAVE_METACITY_3_20_0 | ||
266 | 89 | static void | 100 | static void |
267 | 90 | initialize_button_layout (MetaButtonLayout *layout) | 101 | initialize_button_layout (MetaButtonLayout *layout) |
268 | 91 | { | 102 | { |
269 | @@ -151,12 +162,18 @@ | |||
270 | 151 | return META_BUTTON_FUNCTION_LAST; | 162 | return META_BUTTON_FUNCTION_LAST; |
271 | 152 | } | 163 | } |
272 | 153 | } | 164 | } |
273 | 165 | #endif | ||
274 | 154 | 166 | ||
275 | 155 | static void | 167 | static void |
276 | 156 | update_metacity_button_layout_cb (GWDSettings *settings, | 168 | update_metacity_button_layout_cb (GWDSettings *settings, |
277 | 157 | const gchar *button_layout, | 169 | const gchar *button_layout, |
278 | 158 | GWDThemeMetacity *metacity) | 170 | GWDThemeMetacity *metacity) |
279 | 159 | { | 171 | { |
280 | 172 | #ifdef HAVE_METACITY_3_20_0 | ||
281 | 173 | gboolean invert = gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL; | ||
282 | 174 | |||
283 | 175 | metacity->button_layout = meta_button_layout_new (button_layout, invert); | ||
284 | 176 | #else | ||
285 | 160 | MetaButtonLayout new_layout; | 177 | MetaButtonLayout new_layout; |
286 | 161 | 178 | ||
287 | 162 | initialize_button_layout (&new_layout); | 179 | initialize_button_layout (&new_layout); |
288 | @@ -304,6 +321,7 @@ | |||
289 | 304 | } | 321 | } |
290 | 305 | 322 | ||
291 | 306 | metacity->button_layout = new_layout; | 323 | metacity->button_layout = new_layout; |
292 | 324 | #endif | ||
293 | 307 | } | 325 | } |
294 | 308 | 326 | ||
295 | 309 | static MetaButtonType | 327 | static MetaButtonType |
296 | @@ -634,8 +652,13 @@ | |||
297 | 634 | MetaFrameBorders borders; | 652 | MetaFrameBorders borders; |
298 | 635 | 653 | ||
299 | 636 | tmp_flags = flags & ~META_FRAME_MAXIMIZED; | 654 | tmp_flags = flags & ~META_FRAME_MAXIMIZED; |
300 | 655 | #ifdef HAVE_METACITY_3_20_0 | ||
301 | 656 | meta_theme_get_frame_borders (metacity->theme, d->gtk_theme_variant, | ||
302 | 657 | type, tmp_flags, &borders); | ||
303 | 658 | #else | ||
304 | 637 | meta_theme_get_frame_borders (metacity->theme, get_style_info (metacity, d), | 659 | meta_theme_get_frame_borders (metacity->theme, get_style_info (metacity, d), |
305 | 638 | type, d->frame->text_height, tmp_flags, &borders); | 660 | type, d->frame->text_height, tmp_flags, &borders); |
306 | 661 | #endif | ||
307 | 639 | 662 | ||
308 | 640 | if (flags & META_FRAME_ALLOWS_HORIZONTAL_RESIZE) { | 663 | if (flags & META_FRAME_ALLOWS_HORIZONTAL_RESIZE) { |
309 | 641 | frame_win_extents.left += borders.invisible.left; | 664 | frame_win_extents.left += borders.invisible.left; |
310 | @@ -648,8 +671,13 @@ | |||
311 | 648 | } | 671 | } |
312 | 649 | 672 | ||
313 | 650 | tmp_flags = flags | META_FRAME_MAXIMIZED; | 673 | tmp_flags = flags | META_FRAME_MAXIMIZED; |
314 | 674 | #ifdef HAVE_METACITY_3_20_0 | ||
315 | 675 | meta_theme_get_frame_borders (metacity->theme, d->gtk_theme_variant, | ||
316 | 676 | type, tmp_flags, &borders); | ||
317 | 677 | #else | ||
318 | 651 | meta_theme_get_frame_borders (metacity->theme, get_style_info (metacity, d), | 678 | meta_theme_get_frame_borders (metacity->theme, get_style_info (metacity, d), |
319 | 652 | type, d->frame->text_height, tmp_flags, &borders); | 679 | type, d->frame->text_height, tmp_flags, &borders); |
320 | 680 | #endif | ||
321 | 653 | 681 | ||
322 | 654 | if (flags & META_FRAME_ALLOWS_HORIZONTAL_RESIZE) { | 682 | if (flags & META_FRAME_ALLOWS_HORIZONTAL_RESIZE) { |
323 | 655 | frame_max_win_extents.left += borders.invisible.left; | 683 | frame_max_win_extents.left += borders.invisible.left; |
324 | @@ -779,9 +807,15 @@ | |||
325 | 779 | else | 807 | else |
326 | 780 | client_height = decor->border_layout.left.y2 - decor->border_layout.left.y1; | 808 | client_height = decor->border_layout.left.y2 - decor->border_layout.left.y1; |
327 | 781 | 809 | ||
328 | 810 | #ifdef HAVE_METACITY_3_20_0 | ||
329 | 811 | meta_theme_calc_geometry (metacity->theme, decor->gtk_theme_variant, | ||
330 | 812 | frame_type, *flags, client_width, client_height, | ||
331 | 813 | &metacity->button_layout, fgeom); | ||
332 | 814 | #else | ||
333 | 782 | meta_theme_calc_geometry (metacity->theme, get_style_info (metacity, decor), | 815 | meta_theme_calc_geometry (metacity->theme, get_style_info (metacity, decor), |
334 | 783 | frame_type, decor->frame->text_height, *flags, client_width, | 816 | frame_type, decor->frame->text_height, *flags, client_width, |
335 | 784 | client_height, &metacity->button_layout, fgeom); | 817 | client_height, &metacity->button_layout, fgeom); |
336 | 818 | #endif | ||
337 | 785 | } | 819 | } |
338 | 786 | 820 | ||
339 | 787 | static void | 821 | static void |
340 | @@ -834,11 +868,11 @@ | |||
341 | 834 | { | 868 | { |
342 | 835 | int i; | 869 | int i; |
343 | 836 | 870 | ||
345 | 837 | for (i = 0; i < MAX_BUTTONS_PER_CORNER; ++i) | 871 | for (i = 0; i < META_BUTTON_FUNCTION_LAST; ++i) |
346 | 838 | if (metacity->button_layout.left_buttons[i] == function) | 872 | if (metacity->button_layout.left_buttons[i] == function) |
347 | 839 | return TRUE; | 873 | return TRUE; |
348 | 840 | 874 | ||
350 | 841 | for (i = 0; i < MAX_BUTTONS_PER_CORNER; ++i) | 875 | for (i = 0; i < META_BUTTON_FUNCTION_LAST; ++i) |
351 | 842 | if (metacity->button_layout.right_buttons[i] == function) | 876 | if (metacity->button_layout.right_buttons[i] == function) |
352 | 843 | return TRUE; | 877 | return TRUE; |
353 | 844 | 878 | ||
354 | @@ -881,7 +915,12 @@ | |||
355 | 881 | { | 915 | { |
356 | 882 | GWDSettings *settings = gwd_theme_get_settings (GWD_THEME (metacity)); | 916 | GWDSettings *settings = gwd_theme_get_settings (GWD_THEME (metacity)); |
357 | 883 | const gchar *metacity_theme_name = gwd_settings_get_metacity_theme_name (settings); | 917 | const gchar *metacity_theme_name = gwd_settings_get_metacity_theme_name (settings); |
358 | 918 | #ifdef HAVE_METACITY_3_20_0 | ||
359 | 919 | gint metacity_theme_type = gwd_settings_get_metacity_theme_type (settings); | ||
360 | 920 | GError *error = NULL; | ||
361 | 921 | #else | ||
362 | 884 | MetaTheme *theme; | 922 | MetaTheme *theme; |
363 | 923 | #endif | ||
364 | 885 | 924 | ||
365 | 886 | /* metacity_theme can be NULL only in one case - if user has disabled | 925 | /* metacity_theme can be NULL only in one case - if user has disabled |
366 | 887 | * metacity theme with use-metacity-theme setting. In that case | 926 | * metacity theme with use-metacity-theme setting. In that case |
367 | @@ -889,6 +928,23 @@ | |||
368 | 889 | */ | 928 | */ |
369 | 890 | g_assert (metacity_theme_name != NULL); | 929 | g_assert (metacity_theme_name != NULL); |
370 | 891 | 930 | ||
371 | 931 | #ifdef HAVE_METACITY_3_20_0 | ||
372 | 932 | if (metacity_theme_type == -1) | ||
373 | 933 | metacity_theme_type = META_THEME_TYPE_METACITY; | ||
374 | 934 | |||
375 | 935 | metacity->theme = meta_theme_new (metacity_theme_type); | ||
376 | 936 | |||
377 | 937 | if (!meta_theme_load (metacity->theme, metacity_theme_name, &error)) { | ||
378 | 938 | g_warning ("Failed to load metacity theme '%s': %s", | ||
379 | 939 | metacity_theme_name, error->message); | ||
380 | 940 | |||
381 | 941 | g_error_free (error); | ||
382 | 942 | g_clear_object (&metacity->theme); | ||
383 | 943 | |||
384 | 944 | return FALSE; | ||
385 | 945 | } | ||
386 | 946 | #else | ||
387 | 947 | |||
388 | 892 | /* meta_theme_get_current returns the last good theme, so we will try to | 948 | /* meta_theme_get_current returns the last good theme, so we will try to |
389 | 893 | * load theme manually to know that theme is 100% valid. | 949 | * load theme manually to know that theme is 100% valid. |
390 | 894 | */ | 950 | */ |
391 | @@ -905,6 +961,7 @@ | |||
392 | 905 | /* If we are here then we know that this will not fail. */ | 961 | /* If we are here then we know that this will not fail. */ |
393 | 906 | meta_theme_set_current (metacity_theme_name, TRUE); | 962 | meta_theme_set_current (metacity_theme_name, TRUE); |
394 | 907 | metacity->theme = meta_theme_get_current (); | 963 | metacity->theme = meta_theme_get_current (); |
395 | 964 | #endif | ||
396 | 908 | 965 | ||
397 | 909 | return TRUE; | 966 | return TRUE; |
398 | 910 | } | 967 | } |
399 | @@ -940,7 +997,11 @@ | |||
400 | 940 | { | 997 | { |
401 | 941 | GWDThemeMetacity *metacity = GWD_THEME_METACITY (object); | 998 | GWDThemeMetacity *metacity = GWD_THEME_METACITY (object); |
402 | 942 | 999 | ||
403 | 1000 | #ifdef HAVE_METACITY_3_20_0 | ||
404 | 1001 | g_clear_object (&metacity->theme); | ||
405 | 1002 | #else | ||
406 | 943 | g_clear_pointer (&metacity->style_variants, g_hash_table_destroy); | 1003 | g_clear_pointer (&metacity->style_variants, g_hash_table_destroy); |
407 | 1004 | #endif | ||
408 | 944 | 1005 | ||
409 | 945 | if (metacity->button_layout_id != 0) { | 1006 | if (metacity->button_layout_id != 0) { |
410 | 946 | GWDSettings *settings = gwd_theme_get_settings (GWD_THEME (metacity)); | 1007 | GWDSettings *settings = gwd_theme_get_settings (GWD_THEME (metacity)); |
411 | @@ -949,7 +1010,9 @@ | |||
412 | 949 | metacity->button_layout_id = 0; | 1010 | metacity->button_layout_id = 0; |
413 | 950 | } | 1011 | } |
414 | 951 | 1012 | ||
415 | 1013 | #ifndef HAVE_METACITY_3_20_0 | ||
416 | 952 | metacity->titlebar_font = NULL; | 1014 | metacity->titlebar_font = NULL; |
417 | 1015 | #endif | ||
418 | 953 | 1016 | ||
419 | 954 | G_OBJECT_CLASS (gwd_theme_metacity_parent_class)->dispose (object); | 1017 | G_OBJECT_CLASS (gwd_theme_metacity_parent_class)->dispose (object); |
420 | 955 | } | 1018 | } |
421 | @@ -959,7 +1022,11 @@ | |||
422 | 959 | { | 1022 | { |
423 | 960 | GWDThemeMetacity *metacity = GWD_THEME_METACITY (theme); | 1023 | GWDThemeMetacity *metacity = GWD_THEME_METACITY (theme); |
424 | 961 | 1024 | ||
425 | 1025 | #ifdef HAVE_METACITY_3_20_0 | ||
426 | 1026 | meta_theme_invalidate (metacity->theme); | ||
427 | 1027 | #else | ||
428 | 962 | g_hash_table_remove_all (metacity->style_variants); | 1028 | g_hash_table_remove_all (metacity->style_variants); |
429 | 1029 | #endif | ||
430 | 963 | } | 1030 | } |
431 | 964 | 1031 | ||
432 | 965 | static void | 1032 | static void |
433 | @@ -971,8 +1038,10 @@ | |||
434 | 971 | GdkDisplay *display = gdk_display_get_default (); | 1038 | GdkDisplay *display = gdk_display_get_default (); |
435 | 972 | Display *xdisplay = gdk_x11_display_get_xdisplay (display); | 1039 | Display *xdisplay = gdk_x11_display_get_xdisplay (display); |
436 | 973 | GtkWidget *style_window = gwd_theme_get_style_window (theme); | 1040 | GtkWidget *style_window = gwd_theme_get_style_window (theme); |
437 | 1041 | #ifndef HAVE_METACITY_3_20_0 | ||
438 | 974 | MetaStyleInfo *style_info = get_style_info (metacity, decor); | 1042 | MetaStyleInfo *style_info = get_style_info (metacity, decor); |
439 | 975 | GtkStyleContext *context = gtk_widget_get_style_context (style_window); | 1043 | GtkStyleContext *context = gtk_widget_get_style_context (style_window); |
440 | 1044 | #endif | ||
441 | 976 | cairo_surface_t *surface; | 1045 | cairo_surface_t *surface; |
442 | 977 | Picture src; | 1046 | Picture src; |
443 | 978 | MetaButtonState button_states [META_BUTTON_TYPE_LAST]; | 1047 | MetaButtonState button_states [META_BUTTON_TYPE_LAST]; |
444 | @@ -987,8 +1056,10 @@ | |||
445 | 987 | Region right_region; | 1056 | Region right_region; |
446 | 988 | double alpha; | 1057 | double alpha; |
447 | 989 | gboolean shade_alpha; | 1058 | gboolean shade_alpha; |
448 | 1059 | #ifndef HAVE_METACITY_3_20_0 | ||
449 | 990 | MetaFrameStyle *frame_style; | 1060 | MetaFrameStyle *frame_style; |
450 | 991 | GdkRGBA bg_rgba; | 1061 | GdkRGBA bg_rgba; |
451 | 1062 | #endif | ||
452 | 992 | 1063 | ||
453 | 993 | if (!decor->surface || !decor->picture) | 1064 | if (!decor->surface || !decor->picture) |
454 | 994 | return; | 1065 | return; |
455 | @@ -1023,6 +1094,7 @@ | |||
456 | 1023 | for (i = 0; i < META_BUTTON_TYPE_LAST; ++i) | 1094 | for (i = 0; i < META_BUTTON_TYPE_LAST; ++i) |
457 | 1024 | button_states[i] = meta_button_state_for_button_type (metacity, decor, i); | 1095 | button_states[i] = meta_button_state_for_button_type (metacity, decor, i); |
458 | 1025 | 1096 | ||
459 | 1097 | #ifndef HAVE_METACITY_3_20_0 | ||
460 | 1026 | frame_style = meta_theme_get_frame_style (metacity->theme, frame_type, flags); | 1098 | frame_style = meta_theme_get_frame_style (metacity->theme, frame_type, flags); |
461 | 1027 | 1099 | ||
462 | 1028 | gtk_style_context_get_background_color (context, GTK_STATE_FLAG_NORMAL, &bg_rgba); | 1100 | gtk_style_context_get_background_color (context, GTK_STATE_FLAG_NORMAL, &bg_rgba); |
463 | @@ -1034,6 +1106,7 @@ | |||
464 | 1034 | 1106 | ||
465 | 1035 | bg_rgba.alpha = frame_style->window_background_alpha / 255.0; | 1107 | bg_rgba.alpha = frame_style->window_background_alpha / 255.0; |
466 | 1036 | } | 1108 | } |
467 | 1109 | #endif | ||
468 | 1037 | 1110 | ||
469 | 1038 | /* Draw something that will be almost invisible to user. This is hacky way | 1111 | /* Draw something that will be almost invisible to user. This is hacky way |
470 | 1039 | * to fix invisible decorations. */ | 1112 | * to fix invisible decorations. */ |
471 | @@ -1048,19 +1121,28 @@ | |||
472 | 1048 | 1121 | ||
473 | 1049 | cr = cairo_create (surface); | 1122 | cr = cairo_create (surface); |
474 | 1050 | 1123 | ||
475 | 1124 | #ifndef HAVE_METACITY_3_20_0 | ||
476 | 1051 | gdk_cairo_set_source_rgba (cr, &bg_rgba); | 1125 | gdk_cairo_set_source_rgba (cr, &bg_rgba); |
477 | 1052 | cairo_set_operator (cr, CAIRO_OPERATOR_OVER); | 1126 | cairo_set_operator (cr, CAIRO_OPERATOR_OVER); |
478 | 1053 | cairo_paint (cr); | 1127 | cairo_paint (cr); |
479 | 1128 | #endif | ||
480 | 1054 | 1129 | ||
481 | 1055 | src = XRenderCreatePicture (xdisplay, cairo_xlib_surface_get_drawable (surface), | 1130 | src = XRenderCreatePicture (xdisplay, cairo_xlib_surface_get_drawable (surface), |
482 | 1056 | xformat_rgba, 0, NULL); | 1131 | xformat_rgba, 0, NULL); |
483 | 1057 | 1132 | ||
484 | 1133 | #ifdef HAVE_METACITY_3_20_0 | ||
485 | 1134 | meta_theme_draw_frame (metacity->theme, decor->gtk_theme_variant, cr, frame_type, flags, | ||
486 | 1135 | fgeom.width - fgeom.borders.total.left - fgeom.borders.total.right, | ||
487 | 1136 | fgeom.height - fgeom.borders.total.top - fgeom.borders.total.bottom, | ||
488 | 1137 | decor->name, &metacity->button_layout, | ||
489 | 1138 | button_states, decor->icon_pixbuf, NULL); | ||
490 | 1139 | #else | ||
491 | 1058 | meta_theme_draw_frame (metacity->theme, style_info, cr, frame_type, flags, | 1140 | meta_theme_draw_frame (metacity->theme, style_info, cr, frame_type, flags, |
492 | 1059 | fgeom.width - fgeom.borders.total.left - fgeom.borders.total.right, | 1141 | fgeom.width - fgeom.borders.total.left - fgeom.borders.total.right, |
493 | 1060 | fgeom.height - fgeom.borders.total.top - fgeom.borders.total.bottom, | 1142 | fgeom.height - fgeom.borders.total.top - fgeom.borders.total.bottom, |
494 | 1061 | decor->layout, decor->frame->text_height, &metacity->button_layout, | 1143 | decor->layout, decor->frame->text_height, &metacity->button_layout, |
495 | 1062 | button_states, decor->icon_pixbuf, NULL); | 1144 | button_states, decor->icon_pixbuf, NULL); |
497 | 1063 | 1145 | #endif | |
498 | 1064 | 1146 | ||
499 | 1065 | if (fgeom.borders.visible.top) { | 1147 | if (fgeom.borders.visible.top) { |
500 | 1066 | top_region = get_top_border_region (&fgeom, fgeom.width); | 1148 | top_region = get_top_border_region (&fgeom, fgeom.width); |
501 | @@ -1196,23 +1278,35 @@ | |||
502 | 1196 | decor_frame_t *frame) | 1278 | decor_frame_t *frame) |
503 | 1197 | { | 1279 | { |
504 | 1198 | GWDThemeMetacity *metacity = GWD_THEME_METACITY (theme); | 1280 | GWDThemeMetacity *metacity = GWD_THEME_METACITY (theme); |
505 | 1281 | #ifndef HAVE_METACITY_3_20_0 | ||
506 | 1199 | MetaStyleInfo *style_info = get_style_info (metacity, NULL); | 1282 | MetaStyleInfo *style_info = get_style_info (metacity, NULL); |
507 | 1283 | #endif | ||
508 | 1200 | MetaFrameType frame_type = frame_type_from_string (frame->type); | 1284 | MetaFrameType frame_type = frame_type_from_string (frame->type); |
509 | 1201 | MetaFrameBorders borders; | 1285 | MetaFrameBorders borders; |
510 | 1202 | 1286 | ||
511 | 1203 | gwd_decor_frame_ref (frame); | 1287 | gwd_decor_frame_ref (frame); |
512 | 1204 | 1288 | ||
513 | 1289 | #ifdef HAVE_METACITY_3_20_0 | ||
514 | 1290 | meta_theme_get_frame_borders (metacity->theme, NULL, frame_type, | ||
515 | 1291 | 0, &borders); | ||
516 | 1292 | #else | ||
517 | 1205 | meta_theme_get_frame_borders (metacity->theme, style_info, frame_type, | 1293 | meta_theme_get_frame_borders (metacity->theme, style_info, frame_type, |
518 | 1206 | frame->text_height, 0, &borders); | 1294 | frame->text_height, 0, &borders); |
519 | 1295 | #endif | ||
520 | 1207 | 1296 | ||
521 | 1208 | frame->win_extents.top = borders.visible.top; | 1297 | frame->win_extents.top = borders.visible.top; |
522 | 1209 | frame->win_extents.bottom = borders.visible.bottom; | 1298 | frame->win_extents.bottom = borders.visible.bottom; |
523 | 1210 | frame->win_extents.left = borders.visible.left; | 1299 | frame->win_extents.left = borders.visible.left; |
524 | 1211 | frame->win_extents.right = borders.visible.right; | 1300 | frame->win_extents.right = borders.visible.right; |
525 | 1212 | 1301 | ||
526 | 1302 | #ifdef HAVE_METACITY_3_20_0 | ||
527 | 1303 | meta_theme_get_frame_borders (metacity->theme, NULL, frame_type, | ||
528 | 1304 | META_FRAME_MAXIMIZED, &borders); | ||
529 | 1305 | #else | ||
530 | 1213 | meta_theme_get_frame_borders (metacity->theme, style_info, frame_type, | 1306 | meta_theme_get_frame_borders (metacity->theme, style_info, frame_type, |
531 | 1214 | frame->text_height, META_FRAME_MAXIMIZED, | 1307 | frame->text_height, META_FRAME_MAXIMIZED, |
532 | 1215 | &borders); | 1308 | &borders); |
533 | 1309 | #endif | ||
534 | 1216 | 1310 | ||
535 | 1217 | frame->max_win_extents.top = borders.visible.top; | 1311 | frame->max_win_extents.top = borders.visible.top; |
536 | 1218 | frame->max_win_extents.bottom = borders.visible.bottom; | 1312 | frame->max_win_extents.bottom = borders.visible.bottom; |
537 | @@ -1427,13 +1521,20 @@ | |||
538 | 1427 | { | 1521 | { |
539 | 1428 | GWDThemeMetacity *metacity = GWD_THEME_METACITY (theme); | 1522 | GWDThemeMetacity *metacity = GWD_THEME_METACITY (theme); |
540 | 1429 | 1523 | ||
541 | 1524 | #ifdef HAVE_METACITY_3_20_0 | ||
542 | 1525 | meta_theme_set_titlebar_font (metacity->theme, titlebar_font); | ||
543 | 1526 | #else | ||
544 | 1430 | metacity->titlebar_font = titlebar_font; | 1527 | metacity->titlebar_font = titlebar_font; |
545 | 1528 | #endif | ||
546 | 1431 | } | 1529 | } |
547 | 1432 | 1530 | ||
548 | 1433 | static PangoFontDescription * | 1531 | static PangoFontDescription * |
549 | 1434 | gwd_theme_metacity_get_titlebar_font (GWDTheme *theme, | 1532 | gwd_theme_metacity_get_titlebar_font (GWDTheme *theme, |
550 | 1435 | decor_frame_t *frame) | 1533 | decor_frame_t *frame) |
551 | 1436 | { | 1534 | { |
552 | 1535 | #ifdef HAVE_METACITY_3_20_0 | ||
553 | 1536 | return NULL; | ||
554 | 1537 | #else | ||
555 | 1437 | GWDThemeMetacity *metacity = GWD_THEME_METACITY (theme); | 1538 | GWDThemeMetacity *metacity = GWD_THEME_METACITY (theme); |
556 | 1438 | MetaStyleInfo *style_info = get_style_info (metacity, NULL); | 1539 | MetaStyleInfo *style_info = get_style_info (metacity, NULL); |
557 | 1439 | PangoFontDescription *font_desc = meta_style_info_create_font_desc (style_info); | 1540 | PangoFontDescription *font_desc = meta_style_info_create_font_desc (style_info); |
558 | @@ -1445,6 +1546,7 @@ | |||
559 | 1445 | meta_frame_style_apply_scale (style, font_desc); | 1546 | meta_frame_style_apply_scale (style, font_desc); |
560 | 1446 | 1547 | ||
561 | 1447 | return font_desc; | 1548 | return font_desc; |
562 | 1549 | #endif | ||
563 | 1448 | } | 1550 | } |
564 | 1449 | 1551 | ||
565 | 1450 | static void | 1552 | static void |
566 | @@ -1469,8 +1571,10 @@ | |||
567 | 1469 | static void | 1571 | static void |
568 | 1470 | gwd_theme_metacity_init (GWDThemeMetacity *metacity) | 1572 | gwd_theme_metacity_init (GWDThemeMetacity *metacity) |
569 | 1471 | { | 1573 | { |
570 | 1574 | #ifndef HAVE_METACITY_3_20_0 | ||
571 | 1472 | metacity->style_variants = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, | 1575 | metacity->style_variants = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, |
572 | 1473 | (GDestroyNotify) meta_style_info_unref); | 1576 | (GDestroyNotify) meta_style_info_unref); |
573 | 1577 | #endif | ||
574 | 1474 | } | 1578 | } |
575 | 1475 | 1579 | ||
576 | 1476 | /** | 1580 | /** |
577 | 1477 | 1581 | ||
578 | === modified file 'gtk/window-decorator/gwd-theme.c' | |||
579 | --- gtk/window-decorator/gwd-theme.c 2016-06-09 20:28:29 +0000 | |||
580 | +++ gtk/window-decorator/gwd-theme.c 2016-06-09 20:28:29 +0000 | |||
581 | @@ -109,7 +109,6 @@ | |||
582 | 109 | 109 | ||
583 | 110 | G_OBJECT_CLASS (gwd_theme_parent_class)->constructed (object); | 110 | G_OBJECT_CLASS (gwd_theme_parent_class)->constructed (object); |
584 | 111 | 111 | ||
585 | 112 | gwd_theme_update_titlebar_font (theme); | ||
586 | 113 | create_style_window (theme); | 112 | create_style_window (theme); |
587 | 114 | } | 113 | } |
588 | 115 | 114 |
"These members aren't strictly dependent on having megacity 3.20 around, so the ifdefs are probably not necessary here."
style_variants and titlebar_font is not used with Metacity 3.20. So there is no need to create and later destroy hash table. Also ifdefs was added to make sure that I don't try to use them with 3.20.