Merge lp:~muktupavels/compiz/gwd-avoid-style-context-warnings into lp:compiz/0.9.12

Proposed by Alberts Muktupāvels
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: 3996
Merged at revision: 3999
Proposed branch: lp:~muktupavels/compiz/gwd-avoid-style-context-warnings
Merge into: lp:compiz/0.9.12
Diff against target: 105 lines (+28/-0)
5 files modified
gtk/window-decorator/cairo.c (+8/-0)
gtk/window-decorator/decorator.c (+4/-0)
gtk/window-decorator/decorprops.c (+4/-0)
gtk/window-decorator/frames.c (+4/-0)
gtk/window-decorator/switcher.c (+8/-0)
To merge this branch: bzr merge lp:~muktupavels/compiz/gwd-avoid-style-context-warnings
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve
Review via email: mp+287465@code.launchpad.net

Commit message

Avoid GtkStyleContext warnings with GTK+ 3.20+.

Description of the change

Avoid GtkStyleContext warnings with GTK+ 3.20+.

To post a comment you must log in.
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

+1

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/cairo.c'
2--- gtk/window-decorator/cairo.c 2015-04-06 15:00:40 +0000
3+++ gtk/window-decorator/cairo.c 2016-02-29 13:46:25 +0000
4@@ -260,7 +260,11 @@
5
6 #define IN_STATE (PRESSED_EVENT_WINDOW | IN_EVENT_WINDOW)
7
8+ gtk_style_context_save (context);
9+ gtk_style_context_set_state (context, GTK_STATE_FLAG_NORMAL);
10 gtk_style_context_get_color (context, GTK_STATE_FLAG_NORMAL, &fg);
11+ gtk_style_context_restore (context);
12+
13 fg.alpha = STROKE_ALPHA;
14
15 if ((state & IN_STATE) == IN_STATE)
16@@ -310,8 +314,12 @@
17 return;
18
19 context = gtk_widget_get_style_context (d->frame->style_window_rgba);
20+
21+ gtk_style_context_save (context);
22+ gtk_style_context_set_state (context, GTK_STATE_FLAG_NORMAL);
23 gtk_style_context_get_background_color (context, GTK_STATE_FLAG_NORMAL, &bg);
24 gtk_style_context_get_color (context, GTK_STATE_FLAG_NORMAL, &fg);
25+ gtk_style_context_restore (context);
26
27 if (d->state & (WNCK_WINDOW_STATE_MAXIMIZED_HORIZONTALLY |
28 WNCK_WINDOW_STATE_MAXIMIZED_VERTICALLY))
29
30=== modified file 'gtk/window-decorator/decorator.c'
31--- gtk/window-decorator/decorator.c 2015-04-06 13:07:06 +0000
32+++ gtk/window-decorator/decorator.c 2016-02-29 13:46:25 +0000
33@@ -88,7 +88,11 @@
34
35 gtk_style_context_add_provider (context, GTK_STYLE_PROVIDER (provider), GTK_STYLE_PROVIDER_PRIORITY_FALLBACK);
36
37+ gtk_style_context_save (context);
38+ gtk_style_context_set_state (context, GTK_STATE_FLAG_NORMAL);
39 gtk_style_context_get (context, GTK_STATE_FLAG_NORMAL, "font", &free_font_desc, NULL);
40+ gtk_style_context_restore (context);
41+
42 font_desc = (const PangoFontDescription *) free_font_desc;
43 }
44
45
46=== modified file 'gtk/window-decorator/decorprops.c'
47--- gtk/window-decorator/decorprops.c 2014-08-27 18:04:33 +0000
48+++ gtk/window-decorator/decorprops.c 2016-02-29 13:46:25 +0000
49@@ -155,7 +155,11 @@
50 0, 0, quads, nQuad, frame_type, frame_state, frame_actions);
51
52 context = gtk_widget_get_style_context (d->frame->style_window_rgba);
53+
54+ gtk_style_context_save (context);
55+ gtk_style_context_set_state (context, GTK_STATE_FLAG_NORMAL);
56 gtk_style_context_get_color (context, GTK_STATE_FLAG_NORMAL, &fg);
57+ gtk_style_context_restore (context);
58
59 fgColor[0] = fg.red;
60 fgColor[1] = fg.green;
61
62=== modified file 'gtk/window-decorator/frames.c'
63--- gtk/window-decorator/frames.c 2015-04-06 13:07:06 +0000
64+++ gtk/window-decorator/frames.c 2016-02-29 13:46:25 +0000
65@@ -225,7 +225,11 @@
66 decor_color_t spot_color;
67
68 context = gtk_widget_get_style_context (widget);
69+
70+ gtk_style_context_save (context);
71+ gtk_style_context_set_state (context, GTK_STATE_FLAG_SELECTED);
72 gtk_style_context_get_background_color (context, GTK_STATE_FLAG_SELECTED, &bg);
73+ gtk_style_context_restore (context);
74
75 spot_color.r = bg.red;
76 spot_color.g = bg.green;
77
78=== modified file 'gtk/window-decorator/switcher.c'
79--- gtk/window-decorator/switcher.c 2015-04-06 13:07:06 +0000
80+++ gtk/window-decorator/switcher.c 2016-02-29 13:46:25 +0000
81@@ -89,8 +89,12 @@
82 return;
83
84 context = gtk_widget_get_style_context (d->frame->style_window_rgba);
85+
86+ gtk_style_context_save (context);
87+ gtk_style_context_set_state (context, GTK_STATE_FLAG_NORMAL);
88 gtk_style_context_get_background_color (context, GTK_STATE_FLAG_NORMAL, &bg);
89 gtk_style_context_get_color (context, GTK_STATE_FLAG_NORMAL, &fg);
90+ gtk_style_context_restore (context);
91
92 color.r = bg.red;
93 color.g = bg.green;
94@@ -281,8 +285,12 @@
95 return;
96
97 context = gtk_widget_get_style_context (d->frame->style_window_rgba);
98+
99+ gtk_style_context_save (context);
100+ gtk_style_context_set_state (context, GTK_STATE_FLAG_NORMAL);
101 gtk_style_context_get_background_color (context, GTK_STATE_FLAG_NORMAL, &bg);
102 gtk_style_context_get_color (context, GTK_STATE_FLAG_NORMAL, &fg);
103+ gtk_style_context_restore (context);
104
105 cr = cairo_create (d->buffer_surface);
106

Subscribers

People subscribed via source and target branches