Merge lp:~compiz-team/compiz/compiz.fix_1140505 into lp:compiz/0.9.9

Proposed by Sam Spilsbury
Status: Superseded
Proposed branch: lp:~compiz-team/compiz/compiz.fix_1140505
Merge into: lp:compiz/0.9.9
Diff against target: 71 lines (+48/-4)
2 files modified
src/window.cpp (+12/-4)
tests/system/xorg-gtest/tests/compiz_xorg_gtest_configure_window.cpp (+36/-0)
To merge this branch: bzr merge lp:~compiz-team/compiz/compiz.fix_1140505
Reviewer Review Type Date Requested Status
Timo Jyrinki Needs Fixing
PS Jenkins bot (community) continuous-integration Needs Fixing
Andrea Azzarone Approve
MC Return Approve
Review via email: mp+151951@code.launchpad.net

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

Commit message

Use the actual change in window size to determine if we need to change
  the frame window size, don't just use the difference in frame extents
  to determine that.

  (LP: #1140505)

Description of the change

Use the actual change in window size to determine if we need to change
  the frame window size, don't just use the difference in frame extents
  to determine that.

  (LP: #1140505)

To post a comment you must log in.
Revision history for this message
MC Return (mc-return) wrote :

LGTM.

review: Approve
Revision history for this message
Andrea Azzarone (azzar1) wrote :

Code looks good. Works here. Thanks! :)

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

The test seems to fail at 'GetImmediateParent' according to jenkins logs.

review: Needs Fixing
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

I'll get on to this later tonight.

On Mon, Mar 11, 2013 at 12:58 PM, Timo Jyrinki
<email address hidden> wrote:
> Review: Needs Fixing
>
> The test seems to fail at 'GetImmediateParent' according to jenkins logs.
> --
> https://code.launchpad.net/~compiz-team/compiz/compiz.fix_1140505/+merge/151951
> Your team Compiz Maintainers is subscribed to branch lp:compiz.

--
Sam Spilsbury

3632. By Sam Spilsbury

Merge lp:~compiz-team/compiz/compiz.fix_1138517

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/window.cpp'
2--- src/window.cpp 2013-02-27 03:24:45 +0000
3+++ src/window.cpp 2013-03-06 13:29:21 +0000
4@@ -3330,11 +3330,19 @@
5 if (lastServerInput.top != serverInput.top)
6 valueMask |= CWY;
7
8- if (lastServerInput.right - lastServerInput.left !=
9- serverInput.right - serverInput.left)
10+ /* Calculate frame extents and protect against underflow */
11+ const unsigned int lastWrapperWidth = std::max (0, serverFrameGeometry.width () -
12+ (lastServerInput.right + lastServerInput.left));
13+ const unsigned int lastWrapperHeight = std::max (0, serverFrameGeometry.height () -
14+ (lastServerInput.bottom + lastServerInput.top));
15+ const unsigned int wrapperWidth = std::max (0, serverFrameGeometry.width () -
16+ (serverInput.right + serverInput.left));
17+ const unsigned int wrapperHeight = std::max (0, serverFrameGeometry.height () -
18+ (serverInput.bottom + serverInput.top));
19+
20+ if (lastWrapperWidth != wrapperWidth)
21 valueMask |= CWWidth;
22- if (lastServerInput.bottom - lastServerInput.top !=
23- serverInput.bottom - serverInput.top)
24+ if (lastWrapperHeight != wrapperHeight)
25 valueMask |= CWHeight;
26
27 if (valueMask)
28
29=== modified file 'tests/system/xorg-gtest/tests/compiz_xorg_gtest_configure_window.cpp'
30--- tests/system/xorg-gtest/tests/compiz_xorg_gtest_configure_window.cpp 2013-02-26 00:52:32 +0000
31+++ tests/system/xorg-gtest/tests/compiz_xorg_gtest_configure_window.cpp 2013-03-06 13:29:21 +0000
32@@ -565,3 +565,39 @@
33 currentWidth + (left + right),
34 currentHeight + (top + bottom)));
35 }
36+
37+/* Check that changing the frame extents by one on each side
38+ * adjusts the wrapper window appropriately */
39+TEST_F (CompizXorgSystemConfigureWindowTest, SetFrameExtentsAdjWrapperWindow)
40+{
41+ ::Display *dpy = Display ();
42+
43+ ReparentedWindow w = CreateWindow (dpy);
44+
45+ int currentX, currentY;
46+ unsigned int currentWidth, currentHeight;
47+ ASSERT_TRUE (QueryGeometry (dpy,
48+ w.frame,
49+ currentX,
50+ currentY,
51+ currentWidth,
52+ currentHeight));
53+
54+ /* Set frame extents and get a response */
55+ int left = 1;
56+ int right = 1;
57+ int top = 1;
58+ int bottom = 1;
59+
60+ SendSetFrameExtentsRequest (w.client, left, right, top, bottom);
61+ ASSERT_TRUE (VerifySetFrameExtentsResponse (w.client, left, right, top, bottom));
62+
63+ /* Wrapper geometry is extents.xy, size.wh */
64+ Window root;
65+ Window wrapper = GetImmediateParent (dpy, w.client, root);
66+ ASSERT_TRUE (VerifyWindowSize (wrapper,
67+ left,
68+ top,
69+ currentWidth,
70+ currentHeight));
71+}

Subscribers

People subscribed via source and target branches