Merge lp:~muktupavels/compiz/fix-for-1404054 into lp:compiz/0.9.12

Proposed by Alberts Muktupāvels
Status: Merged
Approved by: Stephen M. Webb
Approved revision: 3921
Merged at revision: 3918
Proposed branch: lp:~muktupavels/compiz/fix-for-1404054
Merge into: lp:compiz/0.9.12
Diff against target: 50 lines (+21/-8)
2 files modified
gtk/window-decorator/decorator.c (+5/-0)
gtk/window-decorator/gwd-settings-notified.c (+16/-8)
To merge this branch: bzr merge lp:~muktupavels/compiz/fix-for-1404054
Reviewer Review Type Date Requested Status
Stephen M. Webb Approve
Review via email: mp+245188@code.launchpad.net

Commit message

Fix crash with titlebar-uses-system-font enabled. LP: #1404054

Description of the change

Fix crash with titlebar-uses-system-font enabled. LP: #1404054

To post a comment you must log in.
3919. By Alberts Muktupāvels

Avoid a pango critical when titlebar-uses-system-font is enabled.

3920. By Alberts Muktupāvels

Fix indentation.

3921. By Alberts Muktupāvels

Another indentation fix

Revision history for this message
Stephen M. Webb (bregma) wrote :

Verified this works.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'gtk/window-decorator/decorator.c'
2--- gtk/window-decorator/decorator.c 2014-10-29 13:30:19 +0000
3+++ gtk/window-decorator/decorator.c 2014-12-19 13:47:26 +0000
4@@ -151,6 +151,11 @@
5 {
6 GtkCssProvider *provider = gtk_css_provider_get_default ();
7 GtkStyleContext *context = gtk_style_context_new ();
8+ GtkWidgetPath *path = gtk_widget_path_new ();
9+
10+ gtk_widget_path_prepend_type (path, GTK_TYPE_WIDGET);
11+ gtk_style_context_set_path (context, path);
12+ gtk_widget_path_free (path);
13
14 gtk_style_context_add_provider (context, GTK_STYLE_PROVIDER (provider), GTK_STYLE_PROVIDER_PRIORITY_FALLBACK);
15
16
17=== modified file 'gtk/window-decorator/gwd-settings-notified.c'
18--- gtk/window-decorator/gwd-settings-notified.c 2012-09-06 10:12:08 +0000
19+++ gtk/window-decorator/gwd-settings-notified.c 2014-12-19 13:47:26 +0000
20@@ -76,14 +76,22 @@
21 gwd_decor_frame_ref (frame);
22
23 if (frame->titlebar_font)
24- pango_font_description_free (frame->titlebar_font);
25-
26- frame->titlebar_font = pango_font_description_from_string (font_str);
27-
28- scale = (*theme_get_title_scale) (frame);
29-
30- pango_font_description_set_size (frame->titlebar_font,
31- MAX (pango_font_description_get_size (frame->titlebar_font) * scale, 1));
32+ {
33+ pango_font_description_free (frame->titlebar_font);
34+ frame->titlebar_font = NULL;
35+ }
36+
37+ if (font_str)
38+ {
39+ gint size;
40+
41+ frame->titlebar_font = pango_font_description_from_string (font_str);
42+
43+ scale = (*theme_get_title_scale) (frame);
44+ size = MAX (pango_font_description_get_size (frame->titlebar_font) * scale, 1);
45+
46+ pango_font_description_set_size (frame->titlebar_font, size);
47+ }
48
49 gwd_decor_frame_unref (frame);
50 }

Subscribers

People subscribed via source and target branches