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

Proposed by Sam Spilsbury
Status: Merged
Approved by: Sam Spilsbury
Approved revision: 3632
Merged at revision: 3634
Proposed branch: lp:~compiz-team/compiz/compiz.fix_1140505
Merge into: lp:compiz/0.9.9
Prerequisite: lp:~compiz-team/compiz/compiz.fix_1138517
Diff against target: 74 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
PS Jenkins bot (community) continuous-integration Approve
Sam Spilsbury Approve
MC Return Pending
Andrea Azzarone Pending
Timo Jyrinki Pending
Review via email: mp+152619@code.launchpad.net

This proposal supersedes 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 : Posted in a previous version of this proposal

LGTM.

review: Approve
Revision history for this message
Andrea Azzarone (azzar1) wrote : Posted in a previous version of this proposal

Code looks good. Works here. Thanks! :)

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote : Posted in a previous version of this proposal

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

review: Needs Fixing
Revision history for this message
Sam Spilsbury (smspillaz) wrote : Posted in a previous version of this proposal

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

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

The actual change went into raring, lets keep the branches in sync.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

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-03-11 06:41:24 +0000
3+++ src/window.cpp 2013-03-11 06:41:25 +0000
4@@ -3331,11 +3331,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-03-11 06:41:24 +0000
31+++ tests/system/xorg-gtest/tests/compiz_xorg_gtest_configure_window.cpp 2013-03-11 06:41:25 +0000
32@@ -580,6 +580,42 @@
33 currentHeight + (top + bottom)));
34 }
35
36+/* Check that changing the frame extents by one on each side
37+ * adjusts the wrapper window appropriately */
38+TEST_F (CompizXorgSystemConfigureWindowTest, SetFrameExtentsAdjWrapperWindow)
39+{
40+ ::Display *dpy = Display ();
41+
42+ ReparentedWindow w = CreateWindow (dpy);
43+
44+ int currentX, currentY;
45+ unsigned int currentWidth, currentHeight;
46+ ASSERT_TRUE (QueryGeometry (dpy,
47+ w.frame,
48+ currentX,
49+ currentY,
50+ currentWidth,
51+ currentHeight));
52+
53+ /* Set frame extents and get a response */
54+ int left = 1;
55+ int right = 1;
56+ int top = 1;
57+ int bottom = 1;
58+
59+ SendSetFrameExtentsRequest (w.client, left, right, top, bottom);
60+ ASSERT_TRUE (VerifySetFrameExtentsResponse (w.client, left, right, top, bottom));
61+
62+ /* Wrapper geometry is extents.xy, size.wh */
63+ Window root;
64+ Window wrapper = GetImmediateParent (dpy, w.client, root);
65+ ASSERT_TRUE (VerifyWindowSize (wrapper,
66+ left,
67+ top,
68+ currentWidth,
69+ currentHeight));
70+}
71+
72 TEST_F (CompizXorgSystemConfigureWindowTest, SetFrameExtentsUnmapped)
73 {
74 ::Display *dpy = Display ();

Subscribers

People subscribed via source and target branches