Merge lp:~muktupavels/compiz/require-libmetacity-3-20 into lp:compiz/0.9.13
- require-libmetacity-3-20
- Merge into 0.9.13
Proposed by
Alberts Muktupāvels
Status: | Merged |
---|---|
Approved by: | Marco Trevisan (Treviño) |
Approved revision: | 4090 |
Merged at revision: | 4091 |
Proposed branch: | lp:~muktupavels/compiz/require-libmetacity-3-20 |
Merge into: | lp:compiz/0.9.13 |
Diff against target: |
1029 lines (+70/-515) 7 files modified
debian/control (+1/-1) gtk/CMakeLists.txt (+2/-13) gtk/config.h.gtk.in (+0/-3) gtk/window-decorator/gwd-settings-storage.c (+3/-29) gtk/window-decorator/gwd-theme-metacity.c (+20/-409) gtk/window-decorator/gwd-theme.c (+0/-13) gtk/window-decorator/gwd-theme.h (+44/-47) |
To merge this branch: | bzr merge lp:~muktupavels/compiz/require-libmetacity-3-20 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Marco Trevisan (Treviño) | Approve | ||
Review via email:
|
Commit message
gtk-window-
Description of the change
Require libmetacity 3.20 or newer.
To post a comment you must log in.
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Marco Trevisan (Treviño) (3v1n0) wrote : | # |
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Alberts Muktupāvels (muktupavels) wrote : | # |
Yakkety will not have Metacity 3.22 so this can wait...
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Alberts Muktupāvels (muktupavels) wrote : | # |
Can this now be merged?
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'debian/control' | |||
2 | --- debian/control 2016-05-30 13:28:51 +0000 | |||
3 | +++ debian/control 2016-08-31 17:53:28 +0000 | |||
4 | @@ -22,7 +22,7 @@ | |||
5 | 22 | libglibmm-2.4-dev, | 22 | libglibmm-2.4-dev, |
6 | 23 | libgtk-3-dev, | 23 | libgtk-3-dev, |
7 | 24 | libice-dev (>= 1:1.0.1), | 24 | libice-dev (>= 1:1.0.1), |
9 | 25 | libmetacity-dev (>= 1:3.16.0), | 25 | libmetacity-dev (>= 1:3.20.0), |
10 | 26 | libpango1.0-dev, | 26 | libpango1.0-dev, |
11 | 27 | libpng-dev, | 27 | libpng-dev, |
12 | 28 | librsvg2-dev, | 28 | librsvg2-dev, |
13 | 29 | 29 | ||
14 | === modified file 'gtk/CMakeLists.txt' | |||
15 | --- gtk/CMakeLists.txt 2016-06-08 18:35:52 +0000 | |||
16 | +++ gtk/CMakeLists.txt 2016-08-31 17:53:28 +0000 | |||
17 | @@ -25,24 +25,13 @@ | |||
18 | 25 | set (CMAKE_REQUIRED_LIBRARIES "") | 25 | set (CMAKE_REQUIRED_LIBRARIES "") |
19 | 26 | 26 | ||
20 | 27 | if (USE_METACITY) | 27 | if (USE_METACITY) |
22 | 28 | pkg_check_modules (LIBMETACITY libmetacity>=3.19.1) | 28 | pkg_check_modules (LIBMETACITY libmetacity>=3.20.0) |
23 | 29 | 29 | ||
24 | 30 | if (LIBMETACITY_FOUND) | 30 | if (LIBMETACITY_FOUND) |
25 | 31 | compiz_set (HAVE_METACITY_3_20_0 1) | ||
26 | 32 | |||
27 | 33 | set (METACITY_INCLUDE_DIRS ${LIBMETACITY_INCLUDE_DIRS}) | 31 | set (METACITY_INCLUDE_DIRS ${LIBMETACITY_INCLUDE_DIRS}) |
28 | 34 | set (METACITY_LIBRARIES ${LIBMETACITY_LIBRARIES}) | 32 | set (METACITY_LIBRARIES ${LIBMETACITY_LIBRARIES}) |
29 | 35 | else (LIBMETACITY_FOUND) | 33 | else (LIBMETACITY_FOUND) |
40 | 36 | pkg_check_modules (LIBMETACITY_PRIVATE libmetacity-private>=3.16.0) | 34 | compiz_set (USE_METACITY 0) |
31 | 37 | |||
32 | 38 | if (LIBMETACITY_PRIVATE_FOUND) | ||
33 | 39 | compiz_set (HAVE_METACITY_3_20_0 0) | ||
34 | 40 | |||
35 | 41 | set (METACITY_INCLUDE_DIRS ${LIBMETACITY_PRIVATE_INCLUDE_DIRS}) | ||
36 | 42 | set (METACITY_LIBRARIES ${LIBMETACITY_PRIVATE_LIBRARIES}) | ||
37 | 43 | else (LIBMETACITY_PRIVATE_FOUND) | ||
38 | 44 | compiz_set (USE_METACITY 0) | ||
39 | 45 | endif (LIBMETACITY_PRIVATE_FOUND) | ||
41 | 46 | endif (LIBMETACITY_FOUND) | 35 | endif (LIBMETACITY_FOUND) |
42 | 47 | endif (USE_METACITY) | 36 | endif (USE_METACITY) |
43 | 48 | 37 | ||
44 | 49 | 38 | ||
45 | === modified file 'gtk/config.h.gtk.in' | |||
46 | --- gtk/config.h.gtk.in 2016-06-01 16:08:13 +0000 | |||
47 | +++ gtk/config.h.gtk.in 2016-08-31 17:53:28 +0000 | |||
48 | @@ -1,7 +1,4 @@ | |||
49 | 1 | /* Define to 1 if Metacity support is enabled */ | 1 | /* Define to 1 if Metacity support is enabled */ |
50 | 2 | #cmakedefine USE_METACITY 1 | 2 | #cmakedefine USE_METACITY 1 |
51 | 3 | 3 | ||
52 | 4 | /* Define to 1 if Metacity version >= 3.20.0 */ | ||
53 | 5 | #cmakedefine HAVE_METACITY_3_20_0 1 | ||
54 | 6 | |||
55 | 7 | #define GETTEXT_PACKAGE "${GETTEXT_PACKAGE}" | 4 | #define GETTEXT_PACKAGE "${GETTEXT_PACKAGE}" |
56 | 8 | 5 | ||
57 | === modified file 'gtk/window-decorator/gwd-settings-storage.c' | |||
58 | --- gtk/window-decorator/gwd-settings-storage.c 2016-06-09 20:28:14 +0000 | |||
59 | +++ gtk/window-decorator/gwd-settings-storage.c 2016-08-31 17:53:28 +0000 | |||
60 | @@ -24,7 +24,7 @@ | |||
61 | 24 | 24 | ||
62 | 25 | #include <gtk/gtk.h> | 25 | #include <gtk/gtk.h> |
63 | 26 | 26 | ||
65 | 27 | #ifdef HAVE_METACITY_3_20_0 | 27 | #ifdef USE_METACITY |
66 | 28 | #include <libmetacity/meta-theme.h> | 28 | #include <libmetacity/meta-theme.h> |
67 | 29 | #endif | 29 | #endif |
68 | 30 | 30 | ||
69 | @@ -33,13 +33,7 @@ | |||
70 | 33 | 33 | ||
71 | 34 | static const gchar * ORG_COMPIZ_GWD = "org.compiz.gwd"; | 34 | static const gchar * ORG_COMPIZ_GWD = "org.compiz.gwd"; |
72 | 35 | 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"; |
73 | 36 | |||
74 | 37 | #ifdef HAVE_METACITY_3_20_0 | ||
75 | 38 | static const gchar * ORG_GNOME_METACITY_THEME = "org.gnome.metacity.theme"; | 36 | static const gchar * ORG_GNOME_METACITY_THEME = "org.gnome.metacity.theme"; |
76 | 39 | #else | ||
77 | 40 | static const gchar * ORG_GNOME_METACITY = "org.gnome.metacity"; | ||
78 | 41 | #endif | ||
79 | 42 | |||
80 | 43 | static const gchar * ORG_MATE_MARCO_GENERAL = "org.mate.Marco.general"; | 37 | static const gchar * ORG_MATE_MARCO_GENERAL = "org.mate.Marco.general"; |
81 | 44 | 38 | ||
82 | 45 | static const gchar * ORG_COMPIZ_GWD_KEY_USE_TOOLTIPS = "use-tooltips"; | 39 | static const gchar * ORG_COMPIZ_GWD_KEY_USE_TOOLTIPS = "use-tooltips"; |
83 | @@ -51,12 +45,8 @@ | |||
84 | 51 | static const gchar * ORG_COMPIZ_GWD_KEY_USE_METACITY_THEME = "use-metacity-theme"; | 45 | static const gchar * ORG_COMPIZ_GWD_KEY_USE_METACITY_THEME = "use-metacity-theme"; |
85 | 52 | static const gchar * ORG_COMPIZ_GWD_KEY_MOUSE_WHEEL_ACTION = "mouse-wheel-action"; | 46 | static const gchar * ORG_COMPIZ_GWD_KEY_MOUSE_WHEEL_ACTION = "mouse-wheel-action"; |
86 | 53 | 47 | ||
87 | 54 | #ifdef HAVE_METACITY_3_20_0 | ||
88 | 55 | static const gchar * ORG_GNOME_METACITY_THEME_NAME = "name"; | 48 | static const gchar * ORG_GNOME_METACITY_THEME_NAME = "name"; |
89 | 56 | static const gchar * ORG_GNOME_METACITY_THEME_TYPE = "type"; | 49 | static const gchar * ORG_GNOME_METACITY_THEME_TYPE = "type"; |
90 | 57 | #else | ||
91 | 58 | static const gchar * ORG_GNOME_METACITY_THEME = "theme"; | ||
92 | 59 | #endif | ||
93 | 60 | 50 | ||
94 | 61 | static const gchar * ORG_GNOME_DESKTOP_WM_PREFERENCES_ACTION_DOUBLE_CLICK_TITLEBAR = "action-double-click-titlebar"; | 51 | static const gchar * ORG_GNOME_DESKTOP_WM_PREFERENCES_ACTION_DOUBLE_CLICK_TITLEBAR = "action-double-click-titlebar"; |
95 | 62 | static const gchar * ORG_GNOME_DESKTOP_WM_PREFERENCES_ACTION_MIDDLE_CLICK_TITLEBAR = "action-middle-click-titlebar"; | 52 | static const gchar * ORG_GNOME_DESKTOP_WM_PREFERENCES_ACTION_MIDDLE_CLICK_TITLEBAR = "action-middle-click-titlebar"; |
96 | @@ -213,7 +203,6 @@ | |||
97 | 213 | if (storage->current_desktop == GWD_DESKTOP_MATE && storage->marco) { | 203 | if (storage->current_desktop == GWD_DESKTOP_MATE && storage->marco) { |
98 | 214 | metacity_theme_name = g_settings_get_string (storage->marco, ORG_MATE_MARCO_GENERAL_THEME); | 204 | metacity_theme_name = g_settings_get_string (storage->marco, ORG_MATE_MARCO_GENERAL_THEME); |
99 | 215 | } else if (storage->current_desktop == GWD_DESKTOP_GNOME_FLASHBACK && storage->metacity) { | 205 | } else if (storage->current_desktop == GWD_DESKTOP_GNOME_FLASHBACK && storage->metacity) { |
100 | 216 | #ifdef HAVE_METACITY_3_20_0 | ||
101 | 217 | metacity_theme_type = g_settings_get_enum (storage->metacity, ORG_GNOME_METACITY_THEME_TYPE); | 206 | metacity_theme_type = g_settings_get_enum (storage->metacity, ORG_GNOME_METACITY_THEME_TYPE); |
102 | 218 | 207 | ||
103 | 219 | if (metacity_theme_type == META_THEME_TYPE_GTK) { | 208 | if (metacity_theme_type == META_THEME_TYPE_GTK) { |
104 | @@ -221,9 +210,6 @@ | |||
105 | 221 | } else { | 210 | } else { |
106 | 222 | metacity_theme_name = g_settings_get_string (storage->metacity, ORG_GNOME_METACITY_THEME_NAME); | 211 | metacity_theme_name = g_settings_get_string (storage->metacity, ORG_GNOME_METACITY_THEME_NAME); |
107 | 223 | } | 212 | } |
108 | 224 | #else | ||
109 | 225 | metacity_theme_name = g_settings_get_string (storage->metacity, ORG_GNOME_METACITY_THEME); | ||
110 | 226 | #endif | ||
111 | 227 | } else if (storage->desktop) { | 213 | } else if (storage->desktop) { |
112 | 228 | metacity_theme_name = g_settings_get_string (storage->desktop, ORG_GNOME_DESKTOP_WM_PREFERENCES_THEME); | 214 | metacity_theme_name = g_settings_get_string (storage->desktop, ORG_GNOME_DESKTOP_WM_PREFERENCES_THEME); |
113 | 229 | } else { | 215 | } else { |
114 | @@ -385,14 +371,9 @@ | |||
115 | 385 | const gchar *key, | 371 | const gchar *key, |
116 | 386 | GWDSettingsStorage *storage) | 372 | GWDSettingsStorage *storage) |
117 | 387 | { | 373 | { |
118 | 388 | #ifdef HAVE_METACITY_3_20_0 | ||
119 | 389 | if (strcmp (key, ORG_GNOME_METACITY_THEME_NAME) == 0 || | 374 | if (strcmp (key, ORG_GNOME_METACITY_THEME_NAME) == 0 || |
120 | 390 | strcmp (key, ORG_GNOME_METACITY_THEME_TYPE) == 0) | 375 | strcmp (key, ORG_GNOME_METACITY_THEME_TYPE) == 0) |
121 | 391 | update_metacity_theme (storage); | 376 | update_metacity_theme (storage); |
122 | 392 | #else | ||
123 | 393 | if (strcmp (key, ORG_GNOME_METACITY_THEME) == 0) | ||
124 | 394 | update_metacity_theme (storage); | ||
125 | 395 | #endif | ||
126 | 396 | } | 377 | } |
127 | 397 | 378 | ||
128 | 398 | static void | 379 | static void |
129 | @@ -423,12 +404,12 @@ | |||
130 | 423 | update_button_layout (storage); | 404 | update_button_layout (storage); |
131 | 424 | } | 405 | } |
132 | 425 | 406 | ||
133 | 426 | #ifdef HAVE_METACITY_3_20_0 | ||
134 | 427 | static void | 407 | static void |
135 | 428 | gtk_theme_name_changed (GtkSettings *settings, | 408 | gtk_theme_name_changed (GtkSettings *settings, |
136 | 429 | GParamSpec *pspec, | 409 | GParamSpec *pspec, |
137 | 430 | GWDSettingsStorage *storage) | 410 | GWDSettingsStorage *storage) |
138 | 431 | { | 411 | { |
139 | 412 | #ifdef USE_METACITY | ||
140 | 432 | MetaThemeType type; | 413 | MetaThemeType type; |
141 | 433 | 414 | ||
142 | 434 | if (!storage->metacity) | 415 | if (!storage->metacity) |
143 | @@ -438,8 +419,8 @@ | |||
144 | 438 | 419 | ||
145 | 439 | if (type == META_THEME_TYPE_GTK) | 420 | if (type == META_THEME_TYPE_GTK) |
146 | 440 | update_metacity_theme (storage); | 421 | update_metacity_theme (storage); |
147 | 422 | #endif | ||
148 | 441 | } | 423 | } |
149 | 442 | #endif | ||
150 | 443 | 424 | ||
151 | 444 | static void | 425 | static void |
152 | 445 | gwd_settings_storage_constructed (GObject *object) | 426 | gwd_settings_storage_constructed (GObject *object) |
153 | @@ -573,22 +554,15 @@ | |||
154 | 573 | case GWD_DESKTOP_GNOME_FLASHBACK: | 554 | case GWD_DESKTOP_GNOME_FLASHBACK: |
155 | 574 | storage->gwd = get_settings_no_abort (ORG_COMPIZ_GWD); | 555 | storage->gwd = get_settings_no_abort (ORG_COMPIZ_GWD); |
156 | 575 | storage->desktop = get_settings_no_abort (ORG_GNOME_DESKTOP_WM_PREFERENCES); | 556 | storage->desktop = get_settings_no_abort (ORG_GNOME_DESKTOP_WM_PREFERENCES); |
157 | 576 | |||
158 | 577 | #ifdef HAVE_METACITY_3_20_0 | ||
159 | 578 | storage->metacity = get_settings_no_abort (ORG_GNOME_METACITY_THEME); | 557 | storage->metacity = get_settings_no_abort (ORG_GNOME_METACITY_THEME); |
160 | 579 | #else | ||
161 | 580 | storage->metacity = get_settings_no_abort (ORG_GNOME_METACITY); | ||
162 | 581 | #endif | ||
163 | 582 | 558 | ||
164 | 583 | storage->gtk_decoration_layout_id = | 559 | storage->gtk_decoration_layout_id = |
165 | 584 | g_signal_connect (gtk_settings_get_default (), "notify::gtk-decoration-layout", | 560 | g_signal_connect (gtk_settings_get_default (), "notify::gtk-decoration-layout", |
166 | 585 | G_CALLBACK (gtk_decoration_layout_changed), storage); | 561 | G_CALLBACK (gtk_decoration_layout_changed), storage); |
167 | 586 | 562 | ||
168 | 587 | #ifdef HAVE_METACITY_3_20_0 | ||
169 | 588 | storage->gtk_theme_name_id = | 563 | storage->gtk_theme_name_id = |
170 | 589 | g_signal_connect (gtk_settings_get_default (), "notify::gtk-theme-name", | 564 | g_signal_connect (gtk_settings_get_default (), "notify::gtk-theme-name", |
171 | 590 | G_CALLBACK (gtk_theme_name_changed), storage); | 565 | G_CALLBACK (gtk_theme_name_changed), storage); |
172 | 591 | #endif | ||
173 | 592 | break; | 566 | break; |
174 | 593 | 567 | ||
175 | 594 | case GWD_DESKTOP_MATE: | 568 | case GWD_DESKTOP_MATE: |
176 | 595 | 569 | ||
177 | === modified file 'gtk/window-decorator/gwd-theme-metacity.c' | |||
178 | --- gtk/window-decorator/gwd-theme-metacity.c 2016-06-09 16:06:40 +0000 | |||
179 | +++ gtk/window-decorator/gwd-theme-metacity.c 2016-08-31 17:53:28 +0000 | |||
180 | @@ -27,12 +27,7 @@ | |||
181 | 27 | 27 | ||
182 | 28 | #include "config.h" | 28 | #include "config.h" |
183 | 29 | 29 | ||
184 | 30 | #ifdef HAVE_METACITY_3_20_0 | ||
185 | 31 | #include <libmetacity/meta-theme.h> | 30 | #include <libmetacity/meta-theme.h> |
186 | 32 | #else | ||
187 | 33 | #include <metacity-private/theme.h> | ||
188 | 34 | #include <metacity-private/theme-parser.h> | ||
189 | 35 | #endif | ||
190 | 36 | 31 | ||
191 | 37 | #include "gtk-window-decorator.h" | 32 | #include "gtk-window-decorator.h" |
192 | 38 | #include "gwd-settings.h" | 33 | #include "gwd-settings.h" |
193 | @@ -40,47 +35,16 @@ | |||
194 | 40 | 35 | ||
195 | 41 | struct _GWDThemeMetacity | 36 | struct _GWDThemeMetacity |
196 | 42 | { | 37 | { |
211 | 43 | GObject parent; | 38 | GObject parent; |
212 | 44 | 39 | ||
213 | 45 | MetaTheme *theme; | 40 | MetaTheme *theme; |
214 | 46 | 41 | ||
215 | 47 | #ifndef HAVE_METACITY_3_20_0 | 42 | gulong button_layout_id; |
216 | 48 | GHashTable *style_variants; | 43 | MetaButtonLayout button_layout; |
203 | 49 | #endif | ||
204 | 50 | |||
205 | 51 | gulong button_layout_id; | ||
206 | 52 | MetaButtonLayout button_layout; | ||
207 | 53 | |||
208 | 54 | #ifndef HAVE_METACITY_3_20_0 | ||
209 | 55 | const PangoFontDescription *titlebar_font; | ||
210 | 56 | #endif | ||
217 | 57 | }; | 44 | }; |
218 | 58 | 45 | ||
219 | 59 | G_DEFINE_TYPE (GWDThemeMetacity, gwd_theme_metacity, GWD_TYPE_THEME) | 46 | G_DEFINE_TYPE (GWDThemeMetacity, gwd_theme_metacity, GWD_TYPE_THEME) |
220 | 60 | 47 | ||
221 | 61 | #ifndef HAVE_METACITY_3_20_0 | ||
222 | 62 | static MetaStyleInfo * | ||
223 | 63 | get_style_info (GWDThemeMetacity *metacity, | ||
224 | 64 | decor_t *decor) | ||
225 | 65 | { | ||
226 | 66 | const gchar *variant = decor != NULL ? decor->gtk_theme_variant : NULL; | ||
227 | 67 | const gchar *key = variant != NULL ? variant : "default"; | ||
228 | 68 | MetaStyleInfo *style = g_hash_table_lookup (metacity->style_variants, key); | ||
229 | 69 | |||
230 | 70 | if (style == NULL) { | ||
231 | 71 | GWDTheme *theme = GWD_THEME (metacity); | ||
232 | 72 | GtkWidget *style_window = gwd_theme_get_style_window (theme); | ||
233 | 73 | GdkScreen *screen = gtk_widget_get_screen (style_window); | ||
234 | 74 | |||
235 | 75 | style = meta_theme_create_style_info (screen, variant); | ||
236 | 76 | |||
237 | 77 | g_hash_table_insert (metacity->style_variants, g_strdup (key), style); | ||
238 | 78 | } | ||
239 | 79 | |||
240 | 80 | return style; | ||
241 | 81 | } | ||
242 | 82 | #endif | ||
243 | 83 | |||
244 | 84 | static MetaFrameType | 48 | static MetaFrameType |
245 | 85 | frame_type_from_string (const gchar *str) | 49 | frame_type_from_string (const gchar *str) |
246 | 86 | { | 50 | { |
247 | @@ -96,232 +60,14 @@ | |||
248 | 96 | return META_FRAME_TYPE_NORMAL; | 60 | return META_FRAME_TYPE_NORMAL; |
249 | 97 | } | 61 | } |
250 | 98 | 62 | ||
251 | 99 | #ifndef HAVE_METACITY_3_20_0 | ||
252 | 100 | static void | ||
253 | 101 | initialize_button_layout (MetaButtonLayout *layout) | ||
254 | 102 | { | ||
255 | 103 | gint i; | ||
256 | 104 | |||
257 | 105 | for (i = 0; i < MAX_BUTTONS_PER_CORNER; ++i) { | ||
258 | 106 | layout->left_buttons[i] = META_BUTTON_FUNCTION_LAST; | ||
259 | 107 | layout->right_buttons[i] = META_BUTTON_FUNCTION_LAST; | ||
260 | 108 | layout->left_buttons_has_spacer[i] = FALSE; | ||
261 | 109 | layout->right_buttons_has_spacer[i] = FALSE; | ||
262 | 110 | } | ||
263 | 111 | } | ||
264 | 112 | |||
265 | 113 | static MetaButtonFunction | ||
266 | 114 | meta_button_function_from_string (const char *str) | ||
267 | 115 | { | ||
268 | 116 | if (strcmp (str, "menu") == 0) | ||
269 | 117 | return META_BUTTON_FUNCTION_MENU; | ||
270 | 118 | else if (strcmp (str, "appmenu") == 0) | ||
271 | 119 | return META_BUTTON_FUNCTION_APPMENU; | ||
272 | 120 | else if (strcmp (str, "minimize") == 0) | ||
273 | 121 | return META_BUTTON_FUNCTION_MINIMIZE; | ||
274 | 122 | else if (strcmp (str, "maximize") == 0) | ||
275 | 123 | return META_BUTTON_FUNCTION_MAXIMIZE; | ||
276 | 124 | else if (strcmp (str, "close") == 0) | ||
277 | 125 | return META_BUTTON_FUNCTION_CLOSE; | ||
278 | 126 | else if (strcmp (str, "shade") == 0) | ||
279 | 127 | return META_BUTTON_FUNCTION_SHADE; | ||
280 | 128 | else if (strcmp (str, "above") == 0) | ||
281 | 129 | return META_BUTTON_FUNCTION_ABOVE; | ||
282 | 130 | else if (strcmp (str, "stick") == 0) | ||
283 | 131 | return META_BUTTON_FUNCTION_STICK; | ||
284 | 132 | else if (strcmp (str, "unshade") == 0) | ||
285 | 133 | return META_BUTTON_FUNCTION_UNSHADE; | ||
286 | 134 | else if (strcmp (str, "unabove") == 0) | ||
287 | 135 | return META_BUTTON_FUNCTION_UNABOVE; | ||
288 | 136 | else if (strcmp (str, "unstick") == 0) | ||
289 | 137 | return META_BUTTON_FUNCTION_UNSTICK; | ||
290 | 138 | else | ||
291 | 139 | return META_BUTTON_FUNCTION_LAST; | ||
292 | 140 | } | ||
293 | 141 | |||
294 | 142 | static MetaButtonFunction | ||
295 | 143 | meta_button_opposite_function (MetaButtonFunction ofwhat) | ||
296 | 144 | { | ||
297 | 145 | switch (ofwhat) { | ||
298 | 146 | case META_BUTTON_FUNCTION_SHADE: | ||
299 | 147 | return META_BUTTON_FUNCTION_UNSHADE; | ||
300 | 148 | case META_BUTTON_FUNCTION_UNSHADE: | ||
301 | 149 | return META_BUTTON_FUNCTION_SHADE; | ||
302 | 150 | |||
303 | 151 | case META_BUTTON_FUNCTION_ABOVE: | ||
304 | 152 | return META_BUTTON_FUNCTION_UNABOVE; | ||
305 | 153 | case META_BUTTON_FUNCTION_UNABOVE: | ||
306 | 154 | return META_BUTTON_FUNCTION_ABOVE; | ||
307 | 155 | |||
308 | 156 | case META_BUTTON_FUNCTION_STICK: | ||
309 | 157 | return META_BUTTON_FUNCTION_UNSTICK; | ||
310 | 158 | case META_BUTTON_FUNCTION_UNSTICK: | ||
311 | 159 | return META_BUTTON_FUNCTION_STICK; | ||
312 | 160 | |||
313 | 161 | default: | ||
314 | 162 | return META_BUTTON_FUNCTION_LAST; | ||
315 | 163 | } | ||
316 | 164 | } | ||
317 | 165 | #endif | ||
318 | 166 | |||
319 | 167 | static void | 63 | static void |
320 | 168 | update_metacity_button_layout_cb (GWDSettings *settings, | 64 | update_metacity_button_layout_cb (GWDSettings *settings, |
321 | 169 | const gchar *button_layout, | 65 | const gchar *button_layout, |
322 | 170 | GWDThemeMetacity *metacity) | 66 | GWDThemeMetacity *metacity) |
323 | 171 | { | 67 | { |
324 | 172 | #ifdef HAVE_METACITY_3_20_0 | ||
325 | 173 | gboolean invert = gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL; | 68 | gboolean invert = gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL; |
326 | 174 | 69 | ||
327 | 175 | metacity->button_layout = meta_button_layout_new (button_layout, invert); | 70 | metacity->button_layout = meta_button_layout_new (button_layout, invert); |
328 | 176 | #else | ||
329 | 177 | MetaButtonLayout new_layout; | ||
330 | 178 | |||
331 | 179 | initialize_button_layout (&new_layout); | ||
332 | 180 | |||
333 | 181 | if (button_layout != NULL) { | ||
334 | 182 | gint i; | ||
335 | 183 | gchar **sides; | ||
336 | 184 | MetaButtonFunction f; | ||
337 | 185 | |||
338 | 186 | sides = g_strsplit (button_layout, ":", 2); | ||
339 | 187 | |||
340 | 188 | if (sides[0] != NULL) { | ||
341 | 189 | gchar **buttons; | ||
342 | 190 | gint b; | ||
343 | 191 | gboolean used[META_BUTTON_FUNCTION_LAST]; | ||
344 | 192 | |||
345 | 193 | for (i = 0; i < META_BUTTON_FUNCTION_LAST; ++i) | ||
346 | 194 | used[i] = FALSE; | ||
347 | 195 | |||
348 | 196 | buttons = g_strsplit (sides[0], ",", -1); | ||
349 | 197 | |||
350 | 198 | i = b = 0; | ||
351 | 199 | while (buttons[b] != NULL) { | ||
352 | 200 | f = meta_button_function_from_string (buttons[b]); | ||
353 | 201 | |||
354 | 202 | if (i > 0 && strcmp ("spacer", buttons[b]) == 0) { | ||
355 | 203 | new_layout.left_buttons_has_spacer[i - 1] = TRUE; | ||
356 | 204 | f = meta_button_opposite_function (f); | ||
357 | 205 | |||
358 | 206 | if (f != META_BUTTON_FUNCTION_LAST) | ||
359 | 207 | new_layout.left_buttons_has_spacer[i - 2] = TRUE; | ||
360 | 208 | } else { | ||
361 | 209 | if (f != META_BUTTON_FUNCTION_LAST && !used[f]) { | ||
362 | 210 | used[f] = TRUE; | ||
363 | 211 | new_layout.left_buttons[i++] = f; | ||
364 | 212 | |||
365 | 213 | f = meta_button_opposite_function (f); | ||
366 | 214 | |||
367 | 215 | if (f != META_BUTTON_FUNCTION_LAST) | ||
368 | 216 | new_layout.left_buttons[i++] = f; | ||
369 | 217 | } else { | ||
370 | 218 | g_warning ("Ignoring unknown or already-used " | ||
371 | 219 | "button name \"%s\"", buttons[b]); | ||
372 | 220 | } | ||
373 | 221 | } | ||
374 | 222 | |||
375 | 223 | ++b; | ||
376 | 224 | } | ||
377 | 225 | |||
378 | 226 | new_layout.left_buttons[i] = META_BUTTON_FUNCTION_LAST; | ||
379 | 227 | |||
380 | 228 | g_strfreev (buttons); | ||
381 | 229 | |||
382 | 230 | if (sides[1] != NULL) { | ||
383 | 231 | for (i = 0; i < META_BUTTON_FUNCTION_LAST; ++i) | ||
384 | 232 | used[i] = FALSE; | ||
385 | 233 | |||
386 | 234 | buttons = g_strsplit (sides[1], ",", -1); | ||
387 | 235 | |||
388 | 236 | i = b = 0; | ||
389 | 237 | while (buttons[b] != NULL) { | ||
390 | 238 | f = meta_button_function_from_string (buttons[b]); | ||
391 | 239 | |||
392 | 240 | if (i > 0 && strcmp ("spacer", buttons[b]) == 0) { | ||
393 | 241 | new_layout.right_buttons_has_spacer[i - 1] = TRUE; | ||
394 | 242 | f = meta_button_opposite_function (f); | ||
395 | 243 | |||
396 | 244 | if (f != META_BUTTON_FUNCTION_LAST) | ||
397 | 245 | new_layout.right_buttons_has_spacer[i - 2] = TRUE; | ||
398 | 246 | } else { | ||
399 | 247 | if (f != META_BUTTON_FUNCTION_LAST && !used[f]) { | ||
400 | 248 | used[f] = TRUE; | ||
401 | 249 | new_layout.right_buttons[i++] = f; | ||
402 | 250 | |||
403 | 251 | f = meta_button_opposite_function (f); | ||
404 | 252 | |||
405 | 253 | if (f != META_BUTTON_FUNCTION_LAST) | ||
406 | 254 | new_layout.right_buttons[i++] = f; | ||
407 | 255 | } else { | ||
408 | 256 | g_warning ("Ignoring unknown or already-used " | ||
409 | 257 | "button name \"%s\"", buttons[b]); | ||
410 | 258 | } | ||
411 | 259 | } | ||
412 | 260 | |||
413 | 261 | ++b; | ||
414 | 262 | } | ||
415 | 263 | |||
416 | 264 | new_layout.right_buttons[i] = META_BUTTON_FUNCTION_LAST; | ||
417 | 265 | |||
418 | 266 | g_strfreev (buttons); | ||
419 | 267 | } | ||
420 | 268 | } | ||
421 | 269 | |||
422 | 270 | g_strfreev (sides); | ||
423 | 271 | |||
424 | 272 | /* Invert the button layout for RTL languages */ | ||
425 | 273 | if (gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL) { | ||
426 | 274 | MetaButtonLayout rtl_layout; | ||
427 | 275 | gint j; | ||
428 | 276 | |||
429 | 277 | initialize_button_layout (&rtl_layout); | ||
430 | 278 | |||
431 | 279 | i = 0; | ||
432 | 280 | while (new_layout.left_buttons[i] != META_BUTTON_FUNCTION_LAST) | ||
433 | 281 | ++i; | ||
434 | 282 | |||
435 | 283 | for (j = 0; j < i; ++j) { | ||
436 | 284 | rtl_layout.right_buttons[j] = new_layout.left_buttons[i - j - 1]; | ||
437 | 285 | |||
438 | 286 | if (j == 0) | ||
439 | 287 | rtl_layout.right_buttons_has_spacer[i - 1] = new_layout.left_buttons_has_spacer[i - j - 1]; | ||
440 | 288 | else | ||
441 | 289 | rtl_layout.right_buttons_has_spacer[j - 1] = new_layout.left_buttons_has_spacer[i - j - 1]; | ||
442 | 290 | } | ||
443 | 291 | |||
444 | 292 | i = 0; | ||
445 | 293 | while (new_layout.right_buttons[i] != META_BUTTON_FUNCTION_LAST) | ||
446 | 294 | ++i; | ||
447 | 295 | |||
448 | 296 | for (j = 0; j < i; ++j) { | ||
449 | 297 | rtl_layout.left_buttons[j] = new_layout.right_buttons[i - j - 1]; | ||
450 | 298 | |||
451 | 299 | if (j == 0) | ||
452 | 300 | rtl_layout.left_buttons_has_spacer[i - 1] = new_layout.right_buttons_has_spacer[i - j - 1]; | ||
453 | 301 | else | ||
454 | 302 | rtl_layout.left_buttons_has_spacer[j - 1] = new_layout.right_buttons_has_spacer[i - j - 1]; | ||
455 | 303 | } | ||
456 | 304 | |||
457 | 305 | new_layout = rtl_layout; | ||
458 | 306 | } | ||
459 | 307 | } else { | ||
460 | 308 | gint i; | ||
461 | 309 | |||
462 | 310 | new_layout.left_buttons[0] = META_BUTTON_FUNCTION_MENU; | ||
463 | 311 | |||
464 | 312 | for (i = 1; i < MAX_BUTTONS_PER_CORNER; ++i) | ||
465 | 313 | new_layout.left_buttons[i] = META_BUTTON_FUNCTION_LAST; | ||
466 | 314 | |||
467 | 315 | new_layout.right_buttons[0] = META_BUTTON_FUNCTION_MINIMIZE; | ||
468 | 316 | new_layout.right_buttons[1] = META_BUTTON_FUNCTION_MAXIMIZE; | ||
469 | 317 | new_layout.right_buttons[2] = META_BUTTON_FUNCTION_CLOSE; | ||
470 | 318 | |||
471 | 319 | for (i = 3; i < MAX_BUTTONS_PER_CORNER; ++i) | ||
472 | 320 | new_layout.right_buttons[i] = META_BUTTON_FUNCTION_LAST; | ||
473 | 321 | } | ||
474 | 322 | |||
475 | 323 | metacity->button_layout = new_layout; | ||
476 | 324 | #endif | ||
477 | 325 | } | 71 | } |
478 | 326 | 72 | ||
479 | 327 | static MetaButtonType | 73 | static MetaButtonType |
480 | @@ -447,8 +193,7 @@ | |||
481 | 447 | } | 193 | } |
482 | 448 | 194 | ||
483 | 449 | static Region | 195 | static Region |
486 | 450 | get_top_border_region (const MetaFrameGeometry *fgeom, | 196 | get_top_border_region (const MetaFrameGeometry *fgeom) |
485 | 451 | gint width) | ||
487 | 452 | { | 197 | { |
488 | 453 | Region corners_xregion; | 198 | Region corners_xregion; |
489 | 454 | Region border_xregion; | 199 | Region border_xregion; |
490 | @@ -459,6 +204,7 @@ | |||
491 | 459 | gint bottom_right_radius; | 204 | gint bottom_right_radius; |
492 | 460 | gint w; | 205 | gint w; |
493 | 461 | gint i; | 206 | gint i; |
494 | 207 | gint width; | ||
495 | 462 | gint height; | 208 | gint height; |
496 | 463 | 209 | ||
497 | 464 | corners_xregion = XCreateRegion (); | 210 | corners_xregion = XCreateRegion (); |
498 | @@ -466,7 +212,7 @@ | |||
499 | 466 | get_corner_radius (fgeom, &top_left_radius, &top_right_radius, | 212 | get_corner_radius (fgeom, &top_left_radius, &top_right_radius, |
500 | 467 | &bottom_left_radius, &bottom_right_radius); | 213 | &bottom_left_radius, &bottom_right_radius); |
501 | 468 | 214 | ||
503 | 469 | width = width - fgeom->borders.invisible.left - fgeom->borders.invisible.right; | 215 | width = fgeom->width - fgeom->borders.invisible.left - fgeom->borders.invisible.right; |
504 | 470 | height = fgeom->borders.visible.top; | 216 | height = fgeom->borders.visible.top; |
505 | 471 | 217 | ||
506 | 472 | if (top_left_radius) { | 218 | if (top_left_radius) { |
507 | @@ -511,8 +257,7 @@ | |||
508 | 511 | } | 257 | } |
509 | 512 | 258 | ||
510 | 513 | static Region | 259 | static Region |
513 | 514 | get_bottom_border_region (const MetaFrameGeometry *fgeom, | 260 | get_bottom_border_region (const MetaFrameGeometry *fgeom) |
512 | 515 | gint width) | ||
514 | 516 | { | 261 | { |
515 | 517 | Region corners_xregion; | 262 | Region corners_xregion; |
516 | 518 | Region border_xregion; | 263 | Region border_xregion; |
517 | @@ -523,6 +268,7 @@ | |||
518 | 523 | gint bottom_right_radius; | 268 | gint bottom_right_radius; |
519 | 524 | gint w; | 269 | gint w; |
520 | 525 | gint i; | 270 | gint i; |
521 | 271 | gint width; | ||
522 | 526 | gint height; | 272 | gint height; |
523 | 527 | 273 | ||
524 | 528 | corners_xregion = XCreateRegion (); | 274 | corners_xregion = XCreateRegion (); |
525 | @@ -530,7 +276,7 @@ | |||
526 | 530 | get_corner_radius (fgeom, &top_left_radius, &top_right_radius, | 276 | get_corner_radius (fgeom, &top_left_radius, &top_right_radius, |
527 | 531 | &bottom_left_radius, &bottom_right_radius); | 277 | &bottom_left_radius, &bottom_right_radius); |
528 | 532 | 278 | ||
530 | 533 | width = width - fgeom->borders.invisible.left - fgeom->borders.invisible.right; | 279 | width = fgeom->width - fgeom->borders.invisible.left - fgeom->borders.invisible.right; |
531 | 534 | height = fgeom->borders.visible.bottom; | 280 | height = fgeom->borders.visible.bottom; |
532 | 535 | 281 | ||
533 | 536 | if (bottom_left_radius) { | 282 | if (bottom_left_radius) { |
534 | @@ -575,8 +321,7 @@ | |||
535 | 575 | } | 321 | } |
536 | 576 | 322 | ||
537 | 577 | static Region | 323 | static Region |
540 | 578 | get_left_border_region (const MetaFrameGeometry *fgeom, | 324 | get_left_border_region (const MetaFrameGeometry *fgeom) |
539 | 579 | gint height) | ||
541 | 580 | { | 325 | { |
542 | 581 | Region border_xregion; | 326 | Region border_xregion; |
543 | 582 | XRectangle xrect; | 327 | XRectangle xrect; |
544 | @@ -586,7 +331,7 @@ | |||
545 | 586 | xrect.x = 0; | 331 | xrect.x = 0; |
546 | 587 | xrect.y = 0; | 332 | xrect.y = 0; |
547 | 588 | xrect.width = fgeom->borders.visible.left; | 333 | xrect.width = fgeom->borders.visible.left; |
549 | 589 | xrect.height = height - fgeom->borders.total.top - fgeom->borders.total.bottom; | 334 | xrect.height = fgeom->height - fgeom->borders.total.top - fgeom->borders.total.bottom; |
550 | 590 | 335 | ||
551 | 591 | XUnionRectWithRegion (&xrect, border_xregion, border_xregion); | 336 | XUnionRectWithRegion (&xrect, border_xregion, border_xregion); |
552 | 592 | 337 | ||
553 | @@ -594,8 +339,7 @@ | |||
554 | 594 | } | 339 | } |
555 | 595 | 340 | ||
556 | 596 | static Region | 341 | static Region |
559 | 597 | get_right_border_region (const MetaFrameGeometry *fgeom, | 342 | get_right_border_region (const MetaFrameGeometry *fgeom) |
558 | 598 | gint height) | ||
560 | 599 | { | 343 | { |
561 | 600 | Region border_xregion; | 344 | Region border_xregion; |
562 | 601 | XRectangle xrect; | 345 | XRectangle xrect; |
563 | @@ -605,7 +349,7 @@ | |||
564 | 605 | xrect.x = 0; | 349 | xrect.x = 0; |
565 | 606 | xrect.y = 0; | 350 | xrect.y = 0; |
566 | 607 | xrect.width = fgeom->borders.visible.right; | 351 | xrect.width = fgeom->borders.visible.right; |
568 | 608 | xrect.height = height - fgeom->borders.total.top - fgeom->borders.total.bottom; | 352 | xrect.height = fgeom->height - fgeom->borders.total.top - fgeom->borders.total.bottom; |
569 | 609 | 353 | ||
570 | 610 | XUnionRectWithRegion (&xrect, border_xregion, border_xregion); | 354 | XUnionRectWithRegion (&xrect, border_xregion, border_xregion); |
571 | 611 | 355 | ||
572 | @@ -652,13 +396,8 @@ | |||
573 | 652 | MetaFrameBorders borders; | 396 | MetaFrameBorders borders; |
574 | 653 | 397 | ||
575 | 654 | tmp_flags = flags & ~META_FRAME_MAXIMIZED; | 398 | tmp_flags = flags & ~META_FRAME_MAXIMIZED; |
576 | 655 | #ifdef HAVE_METACITY_3_20_0 | ||
577 | 656 | meta_theme_get_frame_borders (metacity->theme, d->gtk_theme_variant, | 399 | meta_theme_get_frame_borders (metacity->theme, d->gtk_theme_variant, |
578 | 657 | type, tmp_flags, &borders); | 400 | type, tmp_flags, &borders); |
579 | 658 | #else | ||
580 | 659 | meta_theme_get_frame_borders (metacity->theme, get_style_info (metacity, d), | ||
581 | 660 | type, d->frame->text_height, tmp_flags, &borders); | ||
582 | 661 | #endif | ||
583 | 662 | 401 | ||
584 | 663 | if (flags & META_FRAME_ALLOWS_HORIZONTAL_RESIZE) { | 402 | if (flags & META_FRAME_ALLOWS_HORIZONTAL_RESIZE) { |
585 | 664 | frame_win_extents.left += borders.invisible.left; | 403 | frame_win_extents.left += borders.invisible.left; |
586 | @@ -671,13 +410,8 @@ | |||
587 | 671 | } | 410 | } |
588 | 672 | 411 | ||
589 | 673 | tmp_flags = flags | META_FRAME_MAXIMIZED; | 412 | tmp_flags = flags | META_FRAME_MAXIMIZED; |
590 | 674 | #ifdef HAVE_METACITY_3_20_0 | ||
591 | 675 | meta_theme_get_frame_borders (metacity->theme, d->gtk_theme_variant, | 413 | meta_theme_get_frame_borders (metacity->theme, d->gtk_theme_variant, |
592 | 676 | type, tmp_flags, &borders); | 414 | type, tmp_flags, &borders); |
593 | 677 | #else | ||
594 | 678 | meta_theme_get_frame_borders (metacity->theme, get_style_info (metacity, d), | ||
595 | 679 | type, d->frame->text_height, tmp_flags, &borders); | ||
596 | 680 | #endif | ||
597 | 681 | 415 | ||
598 | 682 | if (flags & META_FRAME_ALLOWS_HORIZONTAL_RESIZE) { | 416 | if (flags & META_FRAME_ALLOWS_HORIZONTAL_RESIZE) { |
599 | 683 | frame_max_win_extents.left += borders.invisible.left; | 417 | frame_max_win_extents.left += borders.invisible.left; |
600 | @@ -807,15 +541,9 @@ | |||
601 | 807 | else | 541 | else |
602 | 808 | client_height = decor->border_layout.left.y2 - decor->border_layout.left.y1; | 542 | client_height = decor->border_layout.left.y2 - decor->border_layout.left.y1; |
603 | 809 | 543 | ||
604 | 810 | #ifdef HAVE_METACITY_3_20_0 | ||
605 | 811 | meta_theme_calc_geometry (metacity->theme, decor->gtk_theme_variant, | 544 | meta_theme_calc_geometry (metacity->theme, decor->gtk_theme_variant, |
606 | 812 | frame_type, *flags, client_width, client_height, | 545 | frame_type, *flags, client_width, client_height, |
607 | 813 | &metacity->button_layout, fgeom); | 546 | &metacity->button_layout, fgeom); |
608 | 814 | #else | ||
609 | 815 | meta_theme_calc_geometry (metacity->theme, get_style_info (metacity, decor), | ||
610 | 816 | frame_type, decor->frame->text_height, *flags, client_width, | ||
611 | 817 | client_height, &metacity->button_layout, fgeom); | ||
612 | 818 | #endif | ||
613 | 819 | } | 547 | } |
614 | 820 | 548 | ||
615 | 821 | static void | 549 | static void |
616 | @@ -915,12 +643,8 @@ | |||
617 | 915 | { | 643 | { |
618 | 916 | GWDSettings *settings = gwd_theme_get_settings (GWD_THEME (metacity)); | 644 | GWDSettings *settings = gwd_theme_get_settings (GWD_THEME (metacity)); |
619 | 917 | const gchar *metacity_theme_name = gwd_settings_get_metacity_theme_name (settings); | 645 | const gchar *metacity_theme_name = gwd_settings_get_metacity_theme_name (settings); |
620 | 918 | #ifdef HAVE_METACITY_3_20_0 | ||
621 | 919 | gint metacity_theme_type = gwd_settings_get_metacity_theme_type (settings); | 646 | gint metacity_theme_type = gwd_settings_get_metacity_theme_type (settings); |
622 | 920 | GError *error = NULL; | 647 | GError *error = NULL; |
623 | 921 | #else | ||
624 | 922 | MetaTheme *theme; | ||
625 | 923 | #endif | ||
626 | 924 | 648 | ||
627 | 925 | /* metacity_theme can be NULL only in one case - if user has disabled | 649 | /* metacity_theme can be NULL only in one case - if user has disabled |
628 | 926 | * metacity theme with use-metacity-theme setting. In that case | 650 | * metacity theme with use-metacity-theme setting. In that case |
629 | @@ -928,7 +652,6 @@ | |||
630 | 928 | */ | 652 | */ |
631 | 929 | g_assert (metacity_theme_name != NULL); | 653 | g_assert (metacity_theme_name != NULL); |
632 | 930 | 654 | ||
633 | 931 | #ifdef HAVE_METACITY_3_20_0 | ||
634 | 932 | if (metacity_theme_type == -1) | 655 | if (metacity_theme_type == -1) |
635 | 933 | metacity_theme_type = META_THEME_TYPE_METACITY; | 656 | metacity_theme_type = META_THEME_TYPE_METACITY; |
636 | 934 | 657 | ||
637 | @@ -943,25 +666,6 @@ | |||
638 | 943 | 666 | ||
639 | 944 | return FALSE; | 667 | return FALSE; |
640 | 945 | } | 668 | } |
641 | 946 | #else | ||
642 | 947 | |||
643 | 948 | /* meta_theme_get_current returns the last good theme, so we will try to | ||
644 | 949 | * load theme manually to know that theme is 100% valid. | ||
645 | 950 | */ | ||
646 | 951 | theme = meta_theme_load (metacity_theme_name, NULL); | ||
647 | 952 | if (theme == NULL) | ||
648 | 953 | return FALSE; | ||
649 | 954 | |||
650 | 955 | /* We can not use this manually loaded theme because Metacity internaly | ||
651 | 956 | * also use meta_theme_get_current wich in this case will return NULL, | ||
652 | 957 | * boom - segfault... | ||
653 | 958 | */ | ||
654 | 959 | meta_theme_free (theme); | ||
655 | 960 | |||
656 | 961 | /* If we are here then we know that this will not fail. */ | ||
657 | 962 | meta_theme_set_current (metacity_theme_name, TRUE); | ||
658 | 963 | metacity->theme = meta_theme_get_current (); | ||
659 | 964 | #endif | ||
660 | 965 | 669 | ||
661 | 966 | return TRUE; | 670 | return TRUE; |
662 | 967 | } | 671 | } |
663 | @@ -997,11 +701,7 @@ | |||
664 | 997 | { | 701 | { |
665 | 998 | GWDThemeMetacity *metacity = GWD_THEME_METACITY (object); | 702 | GWDThemeMetacity *metacity = GWD_THEME_METACITY (object); |
666 | 999 | 703 | ||
667 | 1000 | #ifdef HAVE_METACITY_3_20_0 | ||
668 | 1001 | g_clear_object (&metacity->theme); | 704 | g_clear_object (&metacity->theme); |
669 | 1002 | #else | ||
670 | 1003 | g_clear_pointer (&metacity->style_variants, g_hash_table_destroy); | ||
671 | 1004 | #endif | ||
672 | 1005 | 705 | ||
673 | 1006 | if (metacity->button_layout_id != 0) { | 706 | if (metacity->button_layout_id != 0) { |
674 | 1007 | GWDSettings *settings = gwd_theme_get_settings (GWD_THEME (metacity)); | 707 | GWDSettings *settings = gwd_theme_get_settings (GWD_THEME (metacity)); |
675 | @@ -1010,10 +710,6 @@ | |||
676 | 1010 | metacity->button_layout_id = 0; | 710 | metacity->button_layout_id = 0; |
677 | 1011 | } | 711 | } |
678 | 1012 | 712 | ||
679 | 1013 | #ifndef HAVE_METACITY_3_20_0 | ||
680 | 1014 | metacity->titlebar_font = NULL; | ||
681 | 1015 | #endif | ||
682 | 1016 | |||
683 | 1017 | G_OBJECT_CLASS (gwd_theme_metacity_parent_class)->dispose (object); | 713 | G_OBJECT_CLASS (gwd_theme_metacity_parent_class)->dispose (object); |
684 | 1018 | } | 714 | } |
685 | 1019 | 715 | ||
686 | @@ -1022,11 +718,7 @@ | |||
687 | 1022 | { | 718 | { |
688 | 1023 | GWDThemeMetacity *metacity = GWD_THEME_METACITY (theme); | 719 | GWDThemeMetacity *metacity = GWD_THEME_METACITY (theme); |
689 | 1024 | 720 | ||
690 | 1025 | #ifdef HAVE_METACITY_3_20_0 | ||
691 | 1026 | meta_theme_invalidate (metacity->theme); | 721 | meta_theme_invalidate (metacity->theme); |
692 | 1027 | #else | ||
693 | 1028 | g_hash_table_remove_all (metacity->style_variants); | ||
694 | 1029 | #endif | ||
695 | 1030 | } | 722 | } |
696 | 1031 | 723 | ||
697 | 1032 | static void | 724 | static void |
698 | @@ -1038,10 +730,6 @@ | |||
699 | 1038 | GdkDisplay *display = gdk_display_get_default (); | 730 | GdkDisplay *display = gdk_display_get_default (); |
700 | 1039 | Display *xdisplay = gdk_x11_display_get_xdisplay (display); | 731 | Display *xdisplay = gdk_x11_display_get_xdisplay (display); |
701 | 1040 | GtkWidget *style_window = gwd_theme_get_style_window (theme); | 732 | GtkWidget *style_window = gwd_theme_get_style_window (theme); |
702 | 1041 | #ifndef HAVE_METACITY_3_20_0 | ||
703 | 1042 | MetaStyleInfo *style_info = get_style_info (metacity, decor); | ||
704 | 1043 | GtkStyleContext *context = gtk_widget_get_style_context (style_window); | ||
705 | 1044 | #endif | ||
706 | 1045 | cairo_surface_t *surface; | 733 | cairo_surface_t *surface; |
707 | 1046 | Picture src; | 734 | Picture src; |
708 | 1047 | MetaButtonState button_states [META_BUTTON_TYPE_LAST]; | 735 | MetaButtonState button_states [META_BUTTON_TYPE_LAST]; |
709 | @@ -1056,10 +744,6 @@ | |||
710 | 1056 | Region right_region; | 744 | Region right_region; |
711 | 1057 | double alpha; | 745 | double alpha; |
712 | 1058 | gboolean shade_alpha; | 746 | gboolean shade_alpha; |
713 | 1059 | #ifndef HAVE_METACITY_3_20_0 | ||
714 | 1060 | MetaFrameStyle *frame_style; | ||
715 | 1061 | GdkRGBA bg_rgba; | ||
716 | 1062 | #endif | ||
717 | 1063 | 747 | ||
718 | 1064 | if (!decor->surface || !decor->picture) | 748 | if (!decor->surface || !decor->picture) |
719 | 1065 | return; | 749 | return; |
720 | @@ -1094,20 +778,6 @@ | |||
721 | 1094 | for (i = 0; i < META_BUTTON_TYPE_LAST; ++i) | 778 | for (i = 0; i < META_BUTTON_TYPE_LAST; ++i) |
722 | 1095 | button_states[i] = meta_button_state_for_button_type (metacity, decor, i); | 779 | button_states[i] = meta_button_state_for_button_type (metacity, decor, i); |
723 | 1096 | 780 | ||
724 | 1097 | #ifndef HAVE_METACITY_3_20_0 | ||
725 | 1098 | frame_style = meta_theme_get_frame_style (metacity->theme, frame_type, flags); | ||
726 | 1099 | |||
727 | 1100 | gtk_style_context_get_background_color (context, GTK_STATE_FLAG_NORMAL, &bg_rgba); | ||
728 | 1101 | bg_rgba.alpha = 1.0; | ||
729 | 1102 | |||
730 | 1103 | if (frame_style->window_background_color) { | ||
731 | 1104 | meta_color_spec_render (frame_style->window_background_color, | ||
732 | 1105 | context, &bg_rgba); | ||
733 | 1106 | |||
734 | 1107 | bg_rgba.alpha = frame_style->window_background_alpha / 255.0; | ||
735 | 1108 | } | ||
736 | 1109 | #endif | ||
737 | 1110 | |||
738 | 1111 | /* Draw something that will be almost invisible to user. This is hacky way | 781 | /* Draw something that will be almost invisible to user. This is hacky way |
739 | 1112 | * to fix invisible decorations. */ | 782 | * to fix invisible decorations. */ |
740 | 1113 | cairo_set_source_rgba (cr, 0, 0, 0, 0.01); | 783 | cairo_set_source_rgba (cr, 0, 0, 0, 0.01); |
741 | @@ -1118,34 +788,19 @@ | |||
742 | 1118 | cairo_destroy (cr); | 788 | cairo_destroy (cr); |
743 | 1119 | 789 | ||
744 | 1120 | surface = create_surface (fgeom.width, fgeom.height, style_window); | 790 | surface = create_surface (fgeom.width, fgeom.height, style_window); |
745 | 1121 | |||
746 | 1122 | cr = cairo_create (surface); | 791 | cr = cairo_create (surface); |
747 | 1123 | 792 | ||
748 | 1124 | #ifndef HAVE_METACITY_3_20_0 | ||
749 | 1125 | gdk_cairo_set_source_rgba (cr, &bg_rgba); | ||
750 | 1126 | cairo_set_operator (cr, CAIRO_OPERATOR_OVER); | ||
751 | 1127 | cairo_paint (cr); | ||
752 | 1128 | #endif | ||
753 | 1129 | |||
754 | 1130 | src = XRenderCreatePicture (xdisplay, cairo_xlib_surface_get_drawable (surface), | 793 | src = XRenderCreatePicture (xdisplay, cairo_xlib_surface_get_drawable (surface), |
755 | 1131 | xformat_rgba, 0, NULL); | 794 | xformat_rgba, 0, NULL); |
756 | 1132 | 795 | ||
757 | 1133 | #ifdef HAVE_METACITY_3_20_0 | ||
758 | 1134 | meta_theme_draw_frame (metacity->theme, decor->gtk_theme_variant, cr, frame_type, flags, | 796 | meta_theme_draw_frame (metacity->theme, decor->gtk_theme_variant, cr, frame_type, flags, |
759 | 1135 | fgeom.width - fgeom.borders.total.left - fgeom.borders.total.right, | 797 | fgeom.width - fgeom.borders.total.left - fgeom.borders.total.right, |
760 | 1136 | fgeom.height - fgeom.borders.total.top - fgeom.borders.total.bottom, | 798 | fgeom.height - fgeom.borders.total.top - fgeom.borders.total.bottom, |
761 | 1137 | decor->name, &metacity->button_layout, | 799 | decor->name, &metacity->button_layout, |
762 | 1138 | button_states, decor->icon_pixbuf, NULL); | 800 | button_states, decor->icon_pixbuf, NULL); |
763 | 1139 | #else | ||
764 | 1140 | meta_theme_draw_frame (metacity->theme, style_info, cr, frame_type, flags, | ||
765 | 1141 | fgeom.width - fgeom.borders.total.left - fgeom.borders.total.right, | ||
766 | 1142 | fgeom.height - fgeom.borders.total.top - fgeom.borders.total.bottom, | ||
767 | 1143 | decor->layout, decor->frame->text_height, &metacity->button_layout, | ||
768 | 1144 | button_states, decor->icon_pixbuf, NULL); | ||
769 | 1145 | #endif | ||
770 | 1146 | 801 | ||
771 | 1147 | if (fgeom.borders.visible.top) { | 802 | if (fgeom.borders.visible.top) { |
773 | 1148 | top_region = get_top_border_region (&fgeom, fgeom.width); | 803 | top_region = get_top_border_region (&fgeom); |
774 | 1149 | 804 | ||
775 | 1150 | decor_blend_border_picture (xdisplay, decor->context, src, | 805 | decor_blend_border_picture (xdisplay, decor->context, src, |
776 | 1151 | fgeom.borders.invisible.left, | 806 | fgeom.borders.invisible.left, |
777 | @@ -1156,7 +811,7 @@ | |||
778 | 1156 | } | 811 | } |
779 | 1157 | 812 | ||
780 | 1158 | if (fgeom.borders.visible.bottom) { | 813 | if (fgeom.borders.visible.bottom) { |
782 | 1159 | bottom_region = get_bottom_border_region (&fgeom, fgeom.width); | 814 | bottom_region = get_bottom_border_region (&fgeom); |
783 | 1160 | 815 | ||
784 | 1161 | decor_blend_border_picture (xdisplay, decor->context, src, | 816 | decor_blend_border_picture (xdisplay, decor->context, src, |
785 | 1162 | fgeom.borders.invisible.left, | 817 | fgeom.borders.invisible.left, |
786 | @@ -1167,7 +822,7 @@ | |||
787 | 1167 | } | 822 | } |
788 | 1168 | 823 | ||
789 | 1169 | if (fgeom.borders.visible.left) { | 824 | if (fgeom.borders.visible.left) { |
791 | 1170 | left_region = get_left_border_region (&fgeom, fgeom.height); | 825 | left_region = get_left_border_region (&fgeom); |
792 | 1171 | 826 | ||
793 | 1172 | decor_blend_border_picture (xdisplay, decor->context, src, | 827 | decor_blend_border_picture (xdisplay, decor->context, src, |
794 | 1173 | fgeom.borders.invisible.left, | 828 | fgeom.borders.invisible.left, |
795 | @@ -1178,7 +833,7 @@ | |||
796 | 1178 | } | 833 | } |
797 | 1179 | 834 | ||
798 | 1180 | if (fgeom.borders.visible.right) { | 835 | if (fgeom.borders.visible.right) { |
800 | 1181 | right_region = get_right_border_region (&fgeom, fgeom.height); | 836 | right_region = get_right_border_region (&fgeom); |
801 | 1182 | 837 | ||
802 | 1183 | decor_blend_border_picture (xdisplay, decor->context, src, | 838 | decor_blend_border_picture (xdisplay, decor->context, src, |
803 | 1184 | fgeom.width - fgeom.borders.total.right, | 839 | fgeom.width - fgeom.borders.total.right, |
804 | @@ -1278,35 +933,21 @@ | |||
805 | 1278 | decor_frame_t *frame) | 933 | decor_frame_t *frame) |
806 | 1279 | { | 934 | { |
807 | 1280 | GWDThemeMetacity *metacity = GWD_THEME_METACITY (theme); | 935 | GWDThemeMetacity *metacity = GWD_THEME_METACITY (theme); |
808 | 1281 | #ifndef HAVE_METACITY_3_20_0 | ||
809 | 1282 | MetaStyleInfo *style_info = get_style_info (metacity, NULL); | ||
810 | 1283 | #endif | ||
811 | 1284 | MetaFrameType frame_type = frame_type_from_string (frame->type); | 936 | MetaFrameType frame_type = frame_type_from_string (frame->type); |
812 | 1285 | MetaFrameBorders borders; | 937 | MetaFrameBorders borders; |
813 | 1286 | 938 | ||
814 | 1287 | gwd_decor_frame_ref (frame); | 939 | gwd_decor_frame_ref (frame); |
815 | 1288 | 940 | ||
816 | 1289 | #ifdef HAVE_METACITY_3_20_0 | ||
817 | 1290 | meta_theme_get_frame_borders (metacity->theme, NULL, frame_type, | 941 | meta_theme_get_frame_borders (metacity->theme, NULL, frame_type, |
818 | 1291 | 0, &borders); | 942 | 0, &borders); |
819 | 1292 | #else | ||
820 | 1293 | meta_theme_get_frame_borders (metacity->theme, style_info, frame_type, | ||
821 | 1294 | frame->text_height, 0, &borders); | ||
822 | 1295 | #endif | ||
823 | 1296 | 943 | ||
824 | 1297 | frame->win_extents.top = borders.visible.top; | 944 | frame->win_extents.top = borders.visible.top; |
825 | 1298 | frame->win_extents.bottom = borders.visible.bottom; | 945 | frame->win_extents.bottom = borders.visible.bottom; |
826 | 1299 | frame->win_extents.left = borders.visible.left; | 946 | frame->win_extents.left = borders.visible.left; |
827 | 1300 | frame->win_extents.right = borders.visible.right; | 947 | frame->win_extents.right = borders.visible.right; |
828 | 1301 | 948 | ||
829 | 1302 | #ifdef HAVE_METACITY_3_20_0 | ||
830 | 1303 | meta_theme_get_frame_borders (metacity->theme, NULL, frame_type, | 949 | meta_theme_get_frame_borders (metacity->theme, NULL, frame_type, |
831 | 1304 | META_FRAME_MAXIMIZED, &borders); | 950 | META_FRAME_MAXIMIZED, &borders); |
832 | 1305 | #else | ||
833 | 1306 | meta_theme_get_frame_borders (metacity->theme, style_info, frame_type, | ||
834 | 1307 | frame->text_height, META_FRAME_MAXIMIZED, | ||
835 | 1308 | &borders); | ||
836 | 1309 | #endif | ||
837 | 1310 | 951 | ||
838 | 1311 | frame->max_win_extents.top = borders.visible.top; | 952 | frame->max_win_extents.top = borders.visible.top; |
839 | 1312 | frame->max_win_extents.bottom = borders.visible.bottom; | 953 | frame->max_win_extents.bottom = borders.visible.bottom; |
840 | @@ -1521,32 +1162,7 @@ | |||
841 | 1521 | { | 1162 | { |
842 | 1522 | GWDThemeMetacity *metacity = GWD_THEME_METACITY (theme); | 1163 | GWDThemeMetacity *metacity = GWD_THEME_METACITY (theme); |
843 | 1523 | 1164 | ||
844 | 1524 | #ifdef HAVE_METACITY_3_20_0 | ||
845 | 1525 | meta_theme_set_titlebar_font (metacity->theme, titlebar_font); | 1165 | meta_theme_set_titlebar_font (metacity->theme, titlebar_font); |
846 | 1526 | #else | ||
847 | 1527 | metacity->titlebar_font = titlebar_font; | ||
848 | 1528 | #endif | ||
849 | 1529 | } | ||
850 | 1530 | |||
851 | 1531 | static PangoFontDescription * | ||
852 | 1532 | gwd_theme_metacity_get_titlebar_font (GWDTheme *theme, | ||
853 | 1533 | decor_frame_t *frame) | ||
854 | 1534 | { | ||
855 | 1535 | #ifdef HAVE_METACITY_3_20_0 | ||
856 | 1536 | return NULL; | ||
857 | 1537 | #else | ||
858 | 1538 | GWDThemeMetacity *metacity = GWD_THEME_METACITY (theme); | ||
859 | 1539 | MetaStyleInfo *style_info = get_style_info (metacity, NULL); | ||
860 | 1540 | PangoFontDescription *font_desc = meta_style_info_create_font_desc (style_info); | ||
861 | 1541 | MetaFrameType type = frame_type_from_string (frame->type); | ||
862 | 1542 | MetaFrameFlags flags = 0xc33; /* FIXME */ | ||
863 | 1543 | MetaFrameStyle *style = meta_theme_get_frame_style (metacity->theme, type, flags); | ||
864 | 1544 | |||
865 | 1545 | pango_font_description_merge (font_desc, metacity->titlebar_font, TRUE); | ||
866 | 1546 | meta_frame_style_apply_scale (style, font_desc); | ||
867 | 1547 | |||
868 | 1548 | return font_desc; | ||
869 | 1549 | #endif | ||
870 | 1550 | } | 1166 | } |
871 | 1551 | 1167 | ||
872 | 1552 | static void | 1168 | static void |
873 | @@ -1565,16 +1181,11 @@ | |||
874 | 1565 | theme_class->get_event_window_position = gwd_theme_metacity_get_event_window_position; | 1181 | theme_class->get_event_window_position = gwd_theme_metacity_get_event_window_position; |
875 | 1566 | theme_class->get_button_position = gwd_theme_metacity_get_button_position; | 1182 | theme_class->get_button_position = gwd_theme_metacity_get_button_position; |
876 | 1567 | theme_class->update_titlebar_font = gwd_theme_metacity_update_titlebar_font; | 1183 | theme_class->update_titlebar_font = gwd_theme_metacity_update_titlebar_font; |
877 | 1568 | theme_class->get_titlebar_font = gwd_theme_metacity_get_titlebar_font; | ||
878 | 1569 | } | 1184 | } |
879 | 1570 | 1185 | ||
880 | 1571 | static void | 1186 | static void |
881 | 1572 | gwd_theme_metacity_init (GWDThemeMetacity *metacity) | 1187 | gwd_theme_metacity_init (GWDThemeMetacity *metacity) |
882 | 1573 | { | 1188 | { |
883 | 1574 | #ifndef HAVE_METACITY_3_20_0 | ||
884 | 1575 | metacity->style_variants = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, | ||
885 | 1576 | (GDestroyNotify) meta_style_info_unref); | ||
886 | 1577 | #endif | ||
887 | 1578 | } | 1189 | } |
888 | 1579 | 1190 | ||
889 | 1580 | /** | 1191 | /** |
890 | 1581 | 1192 | ||
891 | === modified file 'gtk/window-decorator/gwd-theme.c' | |||
892 | --- gtk/window-decorator/gwd-theme.c 2016-06-09 16:00:00 +0000 | |||
893 | +++ gtk/window-decorator/gwd-theme.c 2016-08-31 17:53:28 +0000 | |||
894 | @@ -248,13 +248,6 @@ | |||
895 | 248 | { | 248 | { |
896 | 249 | } | 249 | } |
897 | 250 | 250 | ||
898 | 251 | static PangoFontDescription * | ||
899 | 252 | gwd_theme_real_get_titlebar_font (GWDTheme *theme, | ||
900 | 253 | decor_frame_t *frame) | ||
901 | 254 | { | ||
902 | 255 | return NULL; | ||
903 | 256 | } | ||
904 | 257 | |||
905 | 258 | static void | 251 | static void |
906 | 259 | gwd_theme_class_init (GWDThemeClass *theme_class) | 252 | gwd_theme_class_init (GWDThemeClass *theme_class) |
907 | 260 | { | 253 | { |
908 | @@ -275,7 +268,6 @@ | |||
909 | 275 | theme_class->get_event_window_position = gwd_theme_real_get_event_window_position; | 268 | theme_class->get_event_window_position = gwd_theme_real_get_event_window_position; |
910 | 276 | theme_class->get_button_position = gwd_theme_real_get_button_position; | 269 | theme_class->get_button_position = gwd_theme_real_get_button_position; |
911 | 277 | theme_class->update_titlebar_font = gwd_theme_real_update_titlebar_font; | 270 | theme_class->update_titlebar_font = gwd_theme_real_update_titlebar_font; |
912 | 278 | theme_class->get_titlebar_font = gwd_theme_real_get_titlebar_font; | ||
913 | 279 | 271 | ||
914 | 280 | properties[PROP_SETTINGS] = | 272 | properties[PROP_SETTINGS] = |
915 | 281 | g_param_spec_object ("settings", "GWDSettings", "GWDSettings", | 273 | g_param_spec_object ("settings", "GWDSettings", "GWDSettings", |
916 | @@ -433,11 +425,6 @@ | |||
917 | 433 | GWDThemePrivate *priv = gwd_theme_get_instance_private (theme); | 425 | GWDThemePrivate *priv = gwd_theme_get_instance_private (theme); |
918 | 434 | GtkStyleContext *context = gtk_widget_get_style_context (priv->style_window); | 426 | GtkStyleContext *context = gtk_widget_get_style_context (priv->style_window); |
919 | 435 | 427 | ||
920 | 436 | /* Check if Metacity or Cairo will create titlebar font */ | ||
921 | 437 | font_desc = GWD_THEME_GET_CLASS (theme)->get_titlebar_font (theme, frame); | ||
922 | 438 | if (font_desc) | ||
923 | 439 | return font_desc; | ||
924 | 440 | |||
925 | 441 | /* Check if non-system font is in use */ | 428 | /* Check if non-system font is in use */ |
926 | 442 | if (priv->titlebar_font) | 429 | if (priv->titlebar_font) |
927 | 443 | return pango_font_description_copy (priv->titlebar_font); | 430 | return pango_font_description_copy (priv->titlebar_font); |
928 | 444 | 431 | ||
929 | === modified file 'gtk/window-decorator/gwd-theme.h' | |||
930 | --- gtk/window-decorator/gwd-theme.h 2016-06-09 15:47:07 +0000 | |||
931 | +++ gtk/window-decorator/gwd-theme.h 2016-08-31 17:53:28 +0000 | |||
932 | @@ -37,53 +37,50 @@ | |||
933 | 37 | { | 37 | { |
934 | 38 | GObjectClass parent_class; | 38 | GObjectClass parent_class; |
935 | 39 | 39 | ||
983 | 40 | void (* style_updated) (GWDTheme *theme); | 40 | void (* style_updated) (GWDTheme *theme); |
984 | 41 | 41 | ||
985 | 42 | void (* get_shadow) (GWDTheme *theme, | 42 | void (* get_shadow) (GWDTheme *theme, |
986 | 43 | decor_frame_t *frame, | 43 | decor_frame_t *frame, |
987 | 44 | decor_shadow_options_t *options, | 44 | decor_shadow_options_t *options, |
988 | 45 | gboolean active); | 45 | gboolean active); |
989 | 46 | 46 | ||
990 | 47 | void (* draw_window_decoration) (GWDTheme *theme, | 47 | void (* draw_window_decoration) (GWDTheme *theme, |
991 | 48 | decor_t *decor); | 48 | decor_t *decor); |
992 | 49 | 49 | ||
993 | 50 | gboolean (* calc_decoration_size) (GWDTheme *theme, | 50 | gboolean (* calc_decoration_size) (GWDTheme *theme, |
994 | 51 | decor_t *decor, | 51 | decor_t *decor, |
995 | 52 | gint w, | 52 | gint w, |
996 | 53 | gint h, | 53 | gint h, |
997 | 54 | gint name_width, | 54 | gint name_width, |
998 | 55 | gint *width, | 55 | gint *width, |
999 | 56 | gint *height); | 56 | gint *height); |
1000 | 57 | 57 | ||
1001 | 58 | void (* update_border_extents) (GWDTheme *theme, | 58 | void (* update_border_extents) (GWDTheme *theme, |
1002 | 59 | decor_frame_t *frame); | 59 | decor_frame_t *frame); |
1003 | 60 | 60 | ||
1004 | 61 | void (* get_event_window_position) (GWDTheme *theme, | 61 | void (* get_event_window_position) (GWDTheme *theme, |
1005 | 62 | decor_t *decor, | 62 | decor_t *decor, |
1006 | 63 | gint i, | 63 | gint i, |
1007 | 64 | gint j, | 64 | gint j, |
1008 | 65 | gint width, | 65 | gint width, |
1009 | 66 | gint height, | 66 | gint height, |
1010 | 67 | gint *x, | 67 | gint *x, |
1011 | 68 | gint *y, | 68 | gint *y, |
1012 | 69 | gint *w, | 69 | gint *w, |
1013 | 70 | gint *h); | 70 | gint *h); |
1014 | 71 | 71 | ||
1015 | 72 | gboolean (* get_button_position) (GWDTheme *theme, | 72 | gboolean (* get_button_position) (GWDTheme *theme, |
1016 | 73 | decor_t *decor, | 73 | decor_t *decor, |
1017 | 74 | gint i, | 74 | gint i, |
1018 | 75 | gint width, | 75 | gint width, |
1019 | 76 | gint height, | 76 | gint height, |
1020 | 77 | gint *x, | 77 | gint *x, |
1021 | 78 | gint *y, | 78 | gint *y, |
1022 | 79 | gint *w, | 79 | gint *w, |
1023 | 80 | gint *h); | 80 | gint *h); |
1024 | 81 | 81 | ||
1025 | 82 | void (* update_titlebar_font) (GWDTheme *theme, | 82 | void (* update_titlebar_font) (GWDTheme *theme, |
1026 | 83 | const PangoFontDescription *titlebar_font); | 83 | const PangoFontDescription *titlebar_font); |
980 | 84 | |||
981 | 85 | PangoFontDescription * (* get_titlebar_font) (GWDTheme *theme, | ||
982 | 86 | decor_frame_t *frame); | ||
1027 | 87 | }; | 84 | }; |
1028 | 88 | 85 | ||
1029 | 89 | typedef enum | 86 | typedef enum |
We're after feature freeze, we need an exception to get this landed for yakkety