Merge lp:~compiz-team/compiz/raring.fix_1138517 into lp:compiz/0.9.9

Proposed by Sam Spilsbury
Status: Superseded
Proposed branch: lp:~compiz-team/compiz/raring.fix_1138517
Merge into: lp:compiz/0.9.9
Diff against target: 341 lines (+199/-23)
4 files modified
debian/changelog (+10/-0)
src/privatewindow.h (+2/-2)
src/window.cpp (+27/-10)
tests/system/xorg-gtest/tests/compiz_xorg_gtest_configure_window.cpp (+160/-11)
To merge this branch: bzr merge lp:~compiz-team/compiz/raring.fix_1138517
Reviewer Review Type Date Requested Status
Compiz Maintainers Pending
Review via email: mp+151939@code.launchpad.net

This proposal has been superseded by a proposal from 2013-03-06.

Commit message

Don't set lastFrameExtents unless the window geometry actually changed - as
that variable only exists to track changes in the actual geometry of
the window and not the apparant frame extents.

Added tests to verify that behaviour.

(LP: #1138517)

Description of the change

Don't set lastFrameExtents unless the window geometry actually changed - as
that variable only exists to track changes in the actual geometry of
the window and not the apparant frame extents.

Added tests to verify that behaviour.

(LP: #1138517)

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

Merge lp:compiz/raring

3635. By Sam Spilsbury

Only set the decoration if we actually meant to decorate the window.

This allows us to set frame extents and not set the whole decoration
property

Unmerged revisions

3635. By Sam Spilsbury

Only set the decoration if we actually meant to decorate the window.

This allows us to set frame extents and not set the whole decoration
property

3634. By Sam Spilsbury

Merge lp:compiz/raring

3633. By Sam Spilsbury

Unmerge lp:~sil2100/compiz/raring_revert_3616

3632. By Sam Spilsbury

Merge lp:~sil2100/compiz/raring_revert_3616

3631. By Sam Spilsbury

Don't set lastFrameExtents unless the window geometry actually changed - as
that variable only exists to track changes in the actual geometry of
the window and not the apparant frame extents.

Added tests to verify that behaviour.

(LP: #1138517)

3630. By PS Jenkins bot

Releasing 1:0.9.9~daily13.03.01-0ubuntu1 to ubuntu.

Approved by PS Jenkins bot.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2013-02-28 04:02:41 +0000
3+++ debian/changelog 2013-03-06 12:33:21 +0000
4@@ -1,3 +1,13 @@
5+compiz (1:0.9.9~daily13.03.01-0ubuntu1) raring; urgency=low
6+
7+ [ MC Return ]
8+ * Multiple minor code and style issues (LP: #1134251)
9+
10+ [ Automatic PS uploader ]
11+ * Automatic snapshot from revision 3629
12+
13+ -- Automatic PS uploader <ps-jenkins@lists.canonical.com> Fri, 01 Mar 2013 04:02:19 +0000
14+
15 compiz (1:0.9.9~daily13.02.28-0ubuntu1) raring; urgency=low
16
17 [ Sam Spilsbury ]
18
19=== modified file 'src/privatewindow.h'
20--- src/privatewindow.h 2013-02-10 05:01:50 +0000
21+++ src/privatewindow.h 2013-03-06 12:33:21 +0000
22@@ -155,7 +155,7 @@
23
24 void recalcNormalHints ();
25
26- void updateFrameWindow ();
27+ bool updateFrameWindow ();
28
29 void setWindowMatrix ();
30
31@@ -302,7 +302,7 @@
32 int gravity,
33 int direction);
34
35- void updateSize ();
36+ bool updateSize ();
37
38 bool getUserTime (Time& time);
39 void setUserTime (Time time);
40
41=== modified file 'src/window.cpp'
42--- src/window.cpp 2013-02-27 03:24:45 +0000
43+++ src/window.cpp 2013-03-06 12:33:21 +0000
44@@ -807,12 +807,11 @@
45 priv->type = type;
46 }
47
48-
49-void
50+bool
51 PrivateWindow::updateFrameWindow ()
52 {
53 if (!serverFrame)
54- return;
55+ return false;
56
57 XWindowChanges xwc = XWINDOWCHANGES_INIT;
58 unsigned int valueMask = CWX | CWY | CWWidth | CWHeight;
59@@ -826,6 +825,8 @@
60 window->configureXWindow (valueMask, &xwc);
61 window->windowNotify (CompWindowNotifyFrameUpdate);
62 window->recalcActions ();
63+
64+ return true;
65 }
66
67
68@@ -4109,11 +4110,11 @@
69 priv->placed = true;
70 }
71
72-void
73+bool
74 PrivateWindow::updateSize ()
75 {
76 if (window->overrideRedirect () || !managed)
77- return;
78+ return false;
79
80 XWindowChanges xwc = XWINDOWCHANGES_INIT;
81
82@@ -4124,7 +4125,10 @@
83 window->sendSyncRequest ();
84
85 window->configureXWindow (mask, &xwc);
86+ return true;
87 }
88+
89+ return false;
90 }
91
92 int
93@@ -6780,8 +6784,10 @@
94
95 recalcActions ();
96
97- priv->updateSize ();
98- priv->updateFrameWindow ();
99+ bool sizeUpdated = false;
100+
101+ sizeUpdated |= priv->updateSize ();
102+ sizeUpdated |= priv->updateFrameWindow ();
103
104 /* Always send a moveNotify
105 * whenever the frame extents update
106@@ -6789,7 +6795,8 @@
107 moveNotify (0, 0, true);
108
109 /* Once we have updated everything, re-set lastServerInput */
110- priv->lastServerInput = priv->serverInput;
111+ if (sizeUpdated)
112+ priv->lastServerInput = priv->serverInput;
113 }
114
115 /* Use b for _NET_WM_FRAME_EXTENTS here because
116@@ -6909,6 +6916,9 @@
117 * but that's all */
118 XSelectInput (dpy, screen->root (), SubstructureNotifyMask);
119
120+ /* Gravity here is assumed to be SouthEast, clients can update
121+ * that if need be */
122+
123 /* Awaiting a new frame to be given to us */
124 frame = None;
125 serverFrame = XCreateWindow (dpy, screen->root (), 0, 0,
126@@ -6918,10 +6928,17 @@
127 /* Do not get any events from here on */
128 XSelectInput (dpy, screen->root (), NoEventMask);
129
130- wrapper = XCreateWindow (dpy, serverFrame, 0, 0,
131- wa.width, wa.height, 0, wa.depth,
132+ /* If we have some frame extents, we should apply them here and
133+ * set lastFrameExtents */
134+ wrapper = XCreateWindow (dpy, serverFrame,
135+ serverInput.left, serverInput.top,
136+ wa.width - (serverInput.left + serverInput.right),
137+ wa.height - (serverInput.top + serverInput.bottom),
138+ 0, wa.depth,
139 InputOutput, visual, mask, &attr);
140
141+ lastServerInput = serverInput;
142+
143 xwc.stack_mode = Above;
144
145 /* Look for the client in the current server side stacking
146
147=== modified file 'tests/system/xorg-gtest/tests/compiz_xorg_gtest_configure_window.cpp'
148--- tests/system/xorg-gtest/tests/compiz_xorg_gtest_configure_window.cpp 2013-02-26 00:52:32 +0000
149+++ tests/system/xorg-gtest/tests/compiz_xorg_gtest_configure_window.cpp 2013-03-06 12:33:21 +0000
150@@ -55,27 +55,41 @@
151 return ct::AdvanceToNextEventOnSuccess (d, r);
152 }
153
154+Window GetImmediateParent (Display *display,
155+ Window w,
156+ Window &rootReturn)
157+{
158+ Window parentReturn = w;
159+ Window *childrenReturn;
160+ unsigned int nChildrenReturn;
161+
162+ XQueryTree (display,
163+ w,
164+ &rootReturn,
165+ &parentReturn,
166+ &childrenReturn,
167+ &nChildrenReturn);
168+ XFree (childrenReturn);
169+
170+ return parentReturn;
171+}
172+
173+
174 Window GetTopParent (Display *display,
175 Window w)
176 {
177- Window rootReturn;
178+ Window rootReturn = 0;
179 Window parentReturn = w;
180- Window *childrenReturn;
181- unsigned int nChildrenReturn;
182-
183 Window lastParent = 0;
184
185 do
186 {
187 lastParent = parentReturn;
188
189- XQueryTree (display,
190- lastParent,
191- &rootReturn,
192- &parentReturn,
193- &childrenReturn,
194- &nChildrenReturn);
195- XFree (childrenReturn);
196+ parentReturn = GetImmediateParent (display,
197+ lastParent,
198+ rootReturn);
199+
200 } while (parentReturn != rootReturn);
201
202 return lastParent;
203@@ -565,3 +579,138 @@
204 currentWidth + (left + right),
205 currentHeight + (top + bottom)));
206 }
207+
208+TEST_F (CompizXorgSystemConfigureWindowTest, SetFrameExtentsUnmapped)
209+{
210+ ::Display *dpy = Display ();
211+
212+ Window client = ct::CreateNormalWindow (dpy);
213+ WaitForWindowCreation (client);
214+
215+ /* Set frame extents and get a response */
216+ int left = 1;
217+ int right = 1;
218+ int top = 1;
219+ int bottom = 1;
220+
221+ int currentX, currentY;
222+ unsigned int currentWidth, currentHeight;
223+ ASSERT_TRUE (QueryGeometry (dpy,
224+ client,
225+ currentX,
226+ currentY,
227+ currentWidth,
228+ currentHeight));
229+
230+ /* We should get a response with our frame extents but it shouldn't actually
231+ * do anything to the client as it is unmapped */
232+ SendSetFrameExtentsRequest (client, left, right, top, bottom);
233+ ASSERT_TRUE (VerifySetFrameExtentsResponse (client, left, right, top, bottom));
234+
235+ ASSERT_TRUE (VerifyWindowSize (client,
236+ currentX,
237+ currentY,
238+ currentWidth,
239+ currentHeight));
240+}
241+
242+TEST_F (CompizXorgSystemConfigureWindowTest, SetFrameExtentsCorrectMapBehaviour)
243+{
244+ ::Display *dpy = Display ();
245+
246+ Window client = ct::CreateNormalWindow (dpy);
247+ WaitForWindowCreation (client);
248+
249+ /* Set frame extents and get a response */
250+ int left = 1;
251+ int right = 1;
252+ int top = 1;
253+ int bottom = 1;
254+
255+ int currentX, currentY;
256+ unsigned int currentWidth, currentHeight;
257+ ASSERT_TRUE (QueryGeometry (dpy,
258+ client,
259+ currentX,
260+ currentY,
261+ currentWidth,
262+ currentHeight));
263+
264+ SendSetFrameExtentsRequest (client, left, right, top, bottom);
265+ ASSERT_TRUE (VerifySetFrameExtentsResponse (client, left, right, top, bottom));
266+
267+ /* Map the window */
268+ XMapRaised (dpy, client);
269+ WaitForReparentAndMap (dpy, client);
270+
271+ /* Check the geometry of the frame */
272+ Window frame = GetTopParent (dpy, client);
273+ ASSERT_TRUE (VerifyWindowSize (frame,
274+ currentX,
275+ currentY,
276+ currentWidth + (left + right),
277+ currentHeight + (top + bottom)));
278+
279+ /* Wrapper geometry is extents.xy, size.wh */
280+ Window root;
281+ Window wrapper = GetImmediateParent (dpy, client, root);
282+ ASSERT_TRUE (VerifyWindowSize (wrapper,
283+ left,
284+ top,
285+ currentWidth,
286+ currentHeight));
287+}
288+
289+TEST_F (CompizXorgSystemConfigureWindowTest, SetFrameExtentsConsistentBehaviourAfterMap)
290+{
291+ ::Display *dpy = Display ();
292+
293+ Window client = ct::CreateNormalWindow (dpy);
294+ WaitForWindowCreation (client);
295+
296+ /* Set frame extents and get a response */
297+ int left = 1;
298+ int right = 1;
299+ int top = 1;
300+ int bottom = 1;
301+
302+ int currentX, currentY;
303+ unsigned int currentWidth, currentHeight;
304+ ASSERT_TRUE (QueryGeometry (dpy,
305+ client,
306+ currentX,
307+ currentY,
308+ currentWidth,
309+ currentHeight));
310+
311+ SendSetFrameExtentsRequest (client, left, right, top, bottom);
312+ ASSERT_TRUE (VerifySetFrameExtentsResponse (client, left, right, top, bottom));
313+
314+ /* Map the window */
315+ XMapRaised (dpy, client);
316+ WaitForReparentAndMap (dpy, client);
317+
318+ /* Send it another frame extents request */
319+ right = right + 1;
320+ bottom = bottom + 1;
321+
322+ SendSetFrameExtentsRequest (client, left, right, top, bottom);
323+ ASSERT_TRUE (VerifySetFrameExtentsResponse (client, left, right, top, bottom));
324+
325+ /* Check the geometry of the frame */
326+ Window frame = GetTopParent (dpy, client);
327+ ASSERT_TRUE (VerifyWindowSize (frame,
328+ currentX,
329+ currentY,
330+ currentWidth + (left + right),
331+ currentHeight + (top + bottom)));
332+
333+ /* Wrapper geometry is extents.xy, size.wh */
334+ Window root;
335+ Window wrapper = GetImmediateParent (dpy, client, root);
336+ ASSERT_TRUE (VerifyWindowSize (wrapper,
337+ left,
338+ top,
339+ currentWidth,
340+ currentHeight));
341+}

Subscribers

People subscribed via source and target branches