Merge lp:~3v1n0/unity/handle-gtk3.12-deprecations into lp:unity

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: no longer in the source branch.
Merged at revision: 3824
Proposed branch: lp:~3v1n0/unity/handle-gtk3.12-deprecations
Merge into: lp:unity
Diff against target: 55 lines (+11/-0)
3 files modified
decorations/DecorationsForceQuitDialog.cpp (+5/-0)
unity-shared/DecorationStyle.cpp (+4/-0)
unity-shared/PanelStyle.cpp (+2/-0)
To merge this branch: bzr merge lp:~3v1n0/unity/handle-gtk3.12-deprecations
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Brandon Schaefer (community) Approve
Review via email: mp+223086@code.launchpad.net

Commit message

{Panel,Decoration}Style: don't call deprecated gtk_style_context_invalidate function in gtk >= 3.11

To post a comment you must log in.
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

LGTM

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'decorations/DecorationsForceQuitDialog.cpp'
2--- decorations/DecorationsForceQuitDialog.cpp 2014-04-02 13:14:43 +0000
3+++ decorations/DecorationsForceQuitDialog.cpp 2014-06-13 15:23:54 +0000
4@@ -286,8 +286,13 @@
5
6 auto* content_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);
7 gtk_container_set_border_width(GTK_CONTAINER(content_box), 10);
8+#if GTK_CHECK_VERSION(3, 11, 0)
9+ gtk_widget_set_margin_start(content_box, 20);
10+ gtk_widget_set_margin_end(content_box, 20);
11+#else
12 gtk_widget_set_margin_left(content_box, 20);
13 gtk_widget_set_margin_right(content_box, 20);
14+#endif
15 gtk_container_add(GTK_CONTAINER(main_box), content_box);
16
17 auto* title = gtk_label_new(_("This window is not responding"));
18
19=== modified file 'unity-shared/DecorationStyle.cpp'
20--- unity-shared/DecorationStyle.cpp 2014-04-02 17:05:04 +0000
21+++ unity-shared/DecorationStyle.cpp 2014-06-13 15:23:54 +0000
22@@ -169,7 +169,9 @@
23
24 GtkSettings* settings = gtk_settings_get_default();
25 signals_.Add<void, GtkSettings*, GParamSpec*>(settings, "notify::gtk-theme-name", [this] (GtkSettings*, GParamSpec*) {
26+#if !GTK_CHECK_VERSION(3, 11, 0)
27 gtk_style_context_invalidate(ctx_);
28+#endif
29 UpdateThemedValues();
30 parent_->theme = glib::String(GetSettingValue<gchar*>("gtk-theme-name")).Str();
31 LOG_INFO(logger) << "gtk-theme-name changed to " << parent_->theme();
32@@ -192,7 +194,9 @@
33 parent_->font_scale.changed.connect([this] (bool scale) {
34 UpdateTitlePangoContext(parent_->title_font);
35 UpdateMenuItemPangoContext(parent_->font);
36+#if !GTK_CHECK_VERSION(3, 11, 0)
37 gtk_style_context_invalidate(ctx_);
38+#endif
39 parent_->theme.changed.emit(parent_->theme());
40 LOG_INFO(logger) << "font scale changed to " << scale;
41 });
42
43=== modified file 'unity-shared/PanelStyle.cpp'
44--- unity-shared/PanelStyle.cpp 2014-03-31 21:08:10 +0000
45+++ unity-shared/PanelStyle.cpp 2014-06-13 15:23:54 +0000
46@@ -154,7 +154,9 @@
47
48 void Style::RefreshContext()
49 {
50+#if !GTK_CHECK_VERSION(3, 11, 0)
51 gtk_style_context_invalidate(style_context_);
52+#endif
53 bg_textures_.assign(monitors::MAX, BaseTexturePtr());
54
55 changed.emit();