Merge lp:~compiz-team/compiz/compiz.fix_1015593 into lp:compiz/0.9.8

Proposed by Sam Spilsbury
Status: Merged
Merged at revision: 3261
Proposed branch: lp:~compiz-team/compiz/compiz.fix_1015593
Merge into: lp:compiz/0.9.8
Diff against target: 105 lines (+21/-8)
3 files modified
gtk/window-decorator/cairo.c (+3/-0)
gtk/window-decorator/metacity.c (+3/-0)
gtk/window-decorator/wnck.c (+15/-8)
To merge this branch: bzr merge lp:~compiz-team/compiz/compiz.fix_1015593
Reviewer Review Type Date Requested Status
Daniel van Vugt Approve
Review via email: mp+111559@code.launchpad.net

Description of the change

== Problem ==

There are cases where changing the active window will re-add a context member back to undecorated windows. That causes other code to think that the window is decorated when it isn't

== Solution ==

Check if the window is decorated before doing that

== Tests ==

There is no testing framework in gtk-window-decorator.

To post a comment you must log in.
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Looks OK, and seems to work.

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 2011-10-13 09:53:38 +0000
3+++ gtk/window-decorator/cairo.c 2012-06-22 08:10:24 +0000
4@@ -750,6 +750,9 @@
5 decor_layout_t layout;
6 int top_width;
7
8+ if (!d->decorated)
9+ return FALSE;
10+
11 /* To avoid wasting texture memory, we only calculate the minimal
12 * required decoration size then clip and stretch the texture where
13 * appropriate
14
15=== modified file 'gtk/window-decorator/metacity.c'
16--- gtk/window-decorator/metacity.c 2012-03-30 07:01:48 +0000
17+++ gtk/window-decorator/metacity.c 2012-06-22 08:10:24 +0000
18@@ -1142,6 +1142,9 @@
19 decor_context_t *context;
20 decor_shadow_t *shadow;
21
22+ if (!d->decorated)
23+ return FALSE;
24+
25 if ((d->state & META_MAXIMIZED) == META_MAXIMIZED)
26 {
27 if (!d->frame_window)
28
29=== modified file 'gtk/window-decorator/wnck.c'
30--- gtk/window-decorator/wnck.c 2012-06-02 09:02:39 +0000
31+++ gtk/window-decorator/wnck.c 2012-06-22 08:10:24 +0000
32@@ -580,6 +580,13 @@
33 }
34
35 static void
36+set_context_if_decorated (decor_t *d, decor_context_t *context)
37+{
38+ if (d->decorated)
39+ d->context = context;
40+}
41+
42+static void
43 active_window_changed (WnckScreen *screen)
44 {
45 WnckWindow *win;
46@@ -601,12 +608,12 @@
47 {
48 if (d->active)
49 {
50- d->context = &frame->max_window_context_active;
51+ set_context_if_decorated (d, &frame->max_window_context_active);
52 d->shadow = frame->max_border_shadow_active;
53 }
54 else
55 {
56- d->context = &frame->max_window_context_inactive;
57+ set_context_if_decorated (d, &frame->max_window_context_inactive);
58 d->shadow = frame->max_border_shadow_inactive;
59 }
60 }
61@@ -621,12 +628,12 @@
62 {
63 if (d->active)
64 {
65- d->context = &frame->window_context_active;
66+ set_context_if_decorated (d, &frame->window_context_active);
67 d->shadow = frame->border_shadow_active;
68 }
69 else
70 {
71- d->context = &frame->window_context_inactive;
72+ set_context_if_decorated (d, &frame->window_context_inactive);
73 d->shadow = frame->border_shadow_inactive;
74 }
75 }
76@@ -670,12 +677,12 @@
77 {
78 if (d->active)
79 {
80- d->context = &frame->max_window_context_active;
81+ set_context_if_decorated (d, &frame->max_window_context_active);
82 d->shadow = frame->max_border_shadow_active;
83 }
84 else
85 {
86- d->context = &frame->max_window_context_inactive;
87+ set_context_if_decorated (d, &frame->max_window_context_inactive);
88 d->shadow = frame->max_border_shadow_inactive;
89 }
90 }
91@@ -690,12 +697,12 @@
92 {
93 if (d->active)
94 {
95- d->context = &frame->window_context_active;
96+ set_context_if_decorated (d, &frame->window_context_active);
97 d->shadow = frame->border_shadow_active;
98 }
99 else
100 {
101- d->context = &frame->window_context_inactive;
102+ set_context_if_decorated (d, &frame->window_context_inactive);
103 d->shadow = frame->border_shadow_inactive;
104 }
105 }

Subscribers

People subscribed via source and target branches