Merge lp:~compiz-team/compiz-core/oneiric.fix_796594-n into lp:compiz-core/oneiric

Proposed by Sam Spilsbury
Status: Merged
Merged at revision: 2823
Proposed branch: lp:~compiz-team/compiz-core/oneiric.fix_796594-n
Merge into: lp:compiz-core/oneiric
Diff against target: 266 lines (+66/-67)
4 files modified
plugins/decor/src/decor.cpp (+30/-31)
src/window.cpp (+18/-18)
unity/unity_window_decorator/src/events.c (+15/-15)
unity/unity_window_decorator/src/metacity.c (+3/-3)
To merge this branch: bzr merge lp:~compiz-team/compiz-core/oneiric.fix_796594-n
Reviewer Review Type Date Requested Status
Jason Smith (community) Approve
Review via email: mp+77526@code.launchpad.net

This proposal supersedes a proposal from 2011-09-29.

Description of the change

To post a comment you must log in.
2822. By Sam Spilsbury

Remove debug message

Revision history for this message
Jason Smith (jassmith) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/decor/src/decor.cpp'
2--- plugins/decor/src/decor.cpp 2011-09-29 04:01:56 +0000
3+++ plugins/decor/src/decor.cpp 2011-09-30 02:01:23 +0000
4@@ -928,7 +928,7 @@
5 if (!wd)
6 return false;
7
8- if ((window->state () & MAXIMIZE_STATE) == MAXIMIZE_STATE)
9+ if ((window->state () & MAXIMIZE_STATE))
10 window->setWindowFrameExtents (&wd->decor->maxBorder,
11 &wd->decor->maxInput);
12 else if (!window->hasUnmapReference ())
13@@ -1078,7 +1078,7 @@
14 else
15 parent = window->frame ();
16
17- if ((window->state () & MAXIMIZE_STATE) == MAXIMIZE_STATE)
18+ if ((window->state () & MAXIMIZE_STATE))
19 {
20 border = wd->decor->maxBorder;
21 input = wd->decor->maxInput;
22@@ -1208,7 +1208,7 @@
23 int bw = server.border () * 2;
24 CompWindowExtents input;
25
26- if ((window->state () & MAXIMIZE_STATE) == MAXIMIZE_STATE)
27+ if ((window->state () & MAXIMIZE_STATE))
28 input = wd->decor->maxInput;
29 else
30 input = wd->decor->input;
31@@ -1995,37 +1995,36 @@
32 void
33 DecorWindow::stateChangeNotify (unsigned int lastState)
34 {
35- if (!update (true))
36+ if (wd && wd->decor)
37 {
38- if (wd && wd->decor)
39+ int oldShiftX = shiftX ();
40+ int oldShiftY = shiftY ();
41+ int moveDx, moveDy;
42+
43+ if ((window->state () & MAXIMIZE_STATE))
44 {
45- int oldShiftX = shiftX ();
46- int oldShiftY = shiftY ();
47- int moveDx, moveDy;
48-
49- if ((window->state () & MAXIMIZE_STATE) == MAXIMIZE_STATE)
50- window->setWindowFrameExtents (&wd->decor->maxBorder,
51- &wd->decor->maxInput);
52- else
53- window->setWindowFrameExtents (&wd->decor->border,
54- &wd->decor->input);
55-
56- /* Since we immediately update the frame extents, we must
57- * also update the stored saved window geometry in order
58- * to prevent the window from shifting back too far once
59- * unmaximized */
60-
61- moveDx = shiftX () - oldShiftX;
62- moveDy = shiftY () - oldShiftY;
63-
64- if (window->saveMask () & CWX)
65- window->saveWc ().x += moveDx;
66-
67- if (window->saveMask () & CWY)
68- window->saveWc ().y += moveDy;
69-
70- updateFrame ();
71+ window->setWindowFrameExtents (&wd->decor->maxBorder,
72+ &wd->decor->maxInput);
73 }
74+ else
75+ window->setWindowFrameExtents (&wd->decor->border,
76+ &wd->decor->input);
77+
78+ /* Since we immediately update the frame extents, we must
79+ * also update the stored saved window geometry in order
80+ * to prevent the window from shifting back too far once
81+ * unmaximized */
82+
83+ moveDx = shiftX () - oldShiftX;
84+ moveDy = shiftY () - oldShiftY;
85+
86+ if (window->saveMask () & CWX)
87+ window->saveWc ().x += moveDx;
88+
89+ if (window->saveMask () & CWY)
90+ window->saveWc ().y += moveDy;
91+
92+ updateFrame ();
93 }
94
95 window->stateChangeNotify (lastState);
96
97=== modified file 'src/window.cpp'
98--- src/window.cpp 2011-09-29 04:01:56 +0000
99+++ src/window.cpp 2011-09-30 02:01:23 +0000
100@@ -3463,8 +3463,8 @@
101 {
102 saveGeometry (CWY | CWHeight);
103
104- xwc->height = workArea.height () - serverInput.top -
105- serverInput.bottom - old.border () * 2;
106+ xwc->height = workArea.height () - border.top -
107+ border.bottom - old.border () * 2;
108
109 mask |= CWHeight;
110 }
111@@ -3477,8 +3477,8 @@
112 {
113 saveGeometry (CWX | CWWidth);
114
115- xwc->width = workArea.width () - serverInput.left -
116- serverInput.right - old.border () * 2;
117+ xwc->width = workArea.width () - border.left -
118+ border.right - old.border () * 2;
119
120 mask |= CWWidth;
121 }
122@@ -3545,9 +3545,9 @@
123
124 if (state & CompWindowStateMaximizedVertMask)
125 {
126- if (old.y () < y + workArea.y () + serverInput.top)
127+ if (old.y () < y + workArea.y () + border.top)
128 {
129- xwc->y = y + workArea.y () + serverInput.top;
130+ xwc->y = y + workArea.y () + border.top;
131 mask |= CWY;
132 }
133 else
134@@ -3555,16 +3555,16 @@
135 height = xwc->height + old.border () * 2;
136
137 max = y + workArea.bottom ();
138- if (old.y () + (int) old.height () + serverInput.bottom > max)
139+ if (old.y () + (int) old.height () + border.bottom > max)
140 {
141- xwc->y = max - height - serverInput.bottom;
142+ xwc->y = max - height - border.bottom;
143 mask |= CWY;
144 }
145- else if (old.y () + height + serverInput.bottom > max)
146+ else if (old.y () + height + border.bottom > max)
147 {
148 xwc->y = y + workArea.y () +
149- (workArea.height () - serverInput.top - height -
150- serverInput.bottom) / 2 + serverInput.top;
151+ (workArea.height () - border.top - height -
152+ border.bottom) / 2 + border.top;
153 mask |= CWY;
154 }
155 }
156@@ -3572,9 +3572,9 @@
157
158 if (state & CompWindowStateMaximizedHorzMask)
159 {
160- if (old.x () < x + workArea.x () + serverInput.left)
161+ if (old.x () < x + workArea.x () + border.left)
162 {
163- xwc->x = x + workArea.x () + serverInput.left;
164+ xwc->x = x + workArea.x () + border.left;
165 mask |= CWX;
166 }
167 else
168@@ -3582,16 +3582,16 @@
169 width = xwc->width + old.border () * 2;
170
171 max = x + workArea.right ();
172- if (old.x () + (int) old.width () + serverInput.right > max)
173+ if (old.x () + (int) old.width () + border.right > max)
174 {
175- xwc->x = max - width - serverInput.right;
176+ xwc->x = max - width - border.right;
177 mask |= CWX;
178 }
179- else if (old.x () + width + serverInput.right > max)
180+ else if (old.x () + width + border.right > max)
181 {
182 xwc->x = x + workArea.x () +
183- (workArea.width () - serverInput.left - width -
184- serverInput.right) / 2 + serverInput.left;
185+ (workArea.width () - border.left - width -
186+ border.right) / 2 + border.left;
187 mask |= CWX;
188 }
189 }
190
191=== modified file 'unity/unity_window_decorator/src/events.c'
192--- unity/unity_window_decorator/src/events.c 2011-09-22 04:30:04 +0000
193+++ unity/unity_window_decorator/src/events.c 2011-09-30 02:01:23 +0000
194@@ -136,26 +136,26 @@
195 {
196 if (state == BUTTON_EVENT_ACTION_STATE)
197 {
198- if (gtkwd_event->button == 2)
199+ if (wnck_window_is_maximized (win))
200+ wnck_window_unmaximize (win);
201+ if (wnck_window_is_maximized_vertically (win))
202+ wnck_window_unmaximize_vertically (win);
203+ else if (wnck_window_is_maximized_horizontally (win))
204+ wnck_window_unmaximize_horizontally (win);
205+ else
206 {
207- if (wnck_window_is_maximized_vertically (win))
208- wnck_window_unmaximize_vertically (win);
209- else
210+ if (gtkwd_event->button == 2)
211+ {
212 wnck_window_maximize_vertically (win);
213- }
214- else if (gtkwd_event->button == 3)
215- {
216- if (wnck_window_is_maximized_horizontally (win))
217- wnck_window_unmaximize_horizontally (win);
218- else
219+ }
220+ else if (gtkwd_event->button == 3)
221+ {
222 wnck_window_maximize_horizontally (win);
223- }
224- else
225- {
226- if (wnck_window_is_maximized (win))
227- wnck_window_unmaximize (win);
228+ }
229 else
230+ {
231 wnck_window_maximize (win);
232+ }
233 }
234 }
235 }
236
237=== modified file 'unity/unity_window_decorator/src/metacity.c'
238--- unity/unity_window_decorator/src/metacity.c 2011-09-22 04:30:04 +0000
239+++ unity/unity_window_decorator/src/metacity.c 2011-09-30 02:01:23 +0000
240@@ -527,7 +527,7 @@
241 if (d->active)
242 *flags |= (MetaFrameFlags ) META_FRAME_HAS_FOCUS;
243
244- if ((d->state & META_MAXIMIZED) == META_MAXIMIZED)
245+ if ((d->state & META_MAXIMIZED))
246 *flags |= (MetaFrameFlags ) META_FRAME_MAXIMIZED;
247
248 if (d->state & WNCK_WINDOW_STATE_STICKY)
249@@ -1153,7 +1153,7 @@
250 decor_context_t *context;
251 decor_shadow_t *shadow;
252
253- if ((d->state & META_MAXIMIZED) == META_MAXIMIZED)
254+ if ((d->state & META_MAXIMIZED))
255 {
256 if (!d->frame_window)
257 {
258@@ -1217,7 +1217,7 @@
259 }
260 else
261 {
262- if ((d->state & META_MAXIMIZED) == META_MAXIMIZED)
263+ if ((d->state & META_MAXIMIZED))
264 decor_get_default_layout (context, d->client_width,
265 d->client_height - titlebar_height,
266 &layout);

Subscribers

People subscribed via source and target branches

to all changes: