Merge lp:~smspillaz/unity/unity.fix_1091600 into lp:unity

Proposed by Sam Spilsbury
Status: Superseded
Proposed branch: lp:~smspillaz/unity/unity.fix_1091600
Merge into: lp:unity
Diff against target: 149 lines (+0/-93)
2 files modified
plugins/unityshell/src/inputremover.cpp (+0/-90)
plugins/unityshell/src/inputremover.h (+0/-3)
To merge this branch: bzr merge lp:~smspillaz/unity/unity.fix_1091600
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve
Review via email: mp+147285@code.launchpad.net

This proposal has been superseded by a proposal from 2013-02-10.

Commit message

Don't remove bounding rects (LP: #1091600).

Description of the change

Don't remove bounding rects (LP: #1091600). Test this in conjunction with https://code.launchpad.net/~compiz-team/compiz/compiz.fix_729979.1/+merge/147281.

To post a comment you must log in.
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Oh, nice fix! :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/unityshell/src/inputremover.cpp'
2--- plugins/unityshell/src/inputremover.cpp 2012-04-12 13:23:29 +0000
3+++ plugins/unityshell/src/inputremover.cpp 2013-02-08 03:07:52 +0000
4@@ -36,9 +36,6 @@
5 mInputRects (NULL),
6 mNInputRects (0),
7 mInputRectOrdering (0),
8- mBoundingRects (NULL),
9- mNBoundingRects (0),
10- mBoundingRectOrdering (0),
11 mRemoved (false)
12 {
13 /* FIXME: roundtrip */
14@@ -109,38 +106,6 @@
15 XTranslateCoordinates (mDpy, mShapeWindow, parentReturn, 0, 0,
16 &xOffset, &yOffset, &childReturn);
17
18- xsev.kind = ShapeBounding;
19-
20- /* Calculate extents of the bounding shape */
21- if (!mNBoundingRects)
22- {
23- /* No set input shape, we must use the client geometry */
24- xsev.x = x - xOffset;
25- xsev.y = y - yOffset;
26- xsev.width = width;
27- xsev.height = height;
28- xsev.shaped = false;
29- }
30- else
31- {
32- Region boundingRegion = XCreateRegion ();
33-
34- for (int i = 0; i < mNBoundingRects; i++)
35- XUnionRectWithRegion (&(mBoundingRects[i]), boundingRegion, boundingRegion);
36-
37- xsev.x = boundingRegion->extents.x1 - xOffset;
38- xsev.y = boundingRegion->extents.y1 - yOffset;
39- xsev.width = boundingRegion->extents.x2 - boundingRegion->extents.x1;
40- xsev.height = boundingRegion->extents.y2 - boundingRegion->extents.y1;
41- xsev.shaped = true;
42-
43- XDestroyRegion (boundingRegion);
44- }
45-
46- xsev.time = CurrentTime;
47-
48- XSendEvent (mDpy, mShapeWindow, FALSE, NoEventMask, xev);
49- XSendEvent (mDpy, parentReturn, FALSE, NoEventMask, xev);
50 xsev.kind = ShapeInput;
51
52 /* Calculate extents of the bounding shape */
53@@ -180,19 +145,6 @@
54 else
55 {
56 XQueryTree (mDpy, mShapeWindow, &rootReturn, &parentReturn, &children, &nchildren);
57-
58- xsev.kind = ShapeBounding;
59-
60- xsev.x = 0;
61- xsev.y = 0;
62- xsev.width = 0;
63- xsev.height = 0;
64- xsev.shaped = true;
65-
66- xsev.time = CurrentTime;
67- XSendEvent (mDpy, mShapeWindow, FALSE, NoEventMask, xev);
68- XSendEvent (mDpy, parentReturn, FALSE, NoEventMask, xev);
69-
70 xsev.kind = ShapeInput;
71
72 /* Both ShapeBounding and ShapeInput are null */
73@@ -244,27 +196,6 @@
74 mNInputRects = count;
75 mInputRectOrdering = ordering;
76
77- rects = XShapeGetRectangles (mDpy, mShapeWindow, ShapeBounding,
78- &count, &ordering);
79-
80- /* check if the returned shape exactly matches the window shape -
81- * if that is true, the window currently has no set bounding shape */
82- if ((count == 1) &&
83- (rects[0].x == -((int) border)) &&
84- (rects[0].y == -((int) border)) &&
85- (rects[0].width == (width + border)) &&
86- (rects[0].height == (height + border)))
87- {
88- count = 0;
89- }
90-
91- if (mBoundingRects)
92- XFree (mBoundingRects);
93-
94- mBoundingRects = rects;
95- mNBoundingRects = count;
96- mBoundingRectOrdering = ordering;
97-
98 mShapeMask = XShapeInputSelected (mDpy, mShapeWindow);
99
100 return true;
101@@ -281,8 +212,6 @@
102
103 XShapeCombineRectangles (mDpy, mShapeWindow, ShapeInput, 0, 0,
104 NULL, 0, ShapeSet, 0);
105- XShapeCombineRectangles (mDpy, mShapeWindow, ShapeBounding, 0, 0,
106- NULL, 0, ShapeSet, 0);
107
108 XShapeSelectInput (mDpy, mShapeWindow, mShapeMask);
109
110@@ -319,25 +248,6 @@
111 mInputRects = NULL;
112 mNInputRects = 0;
113 }
114-
115- if (mNBoundingRects)
116- {
117- XShapeCombineRectangles (mDpy, mShapeWindow, ShapeBounding, 0, 0,
118- mBoundingRects, mNBoundingRects,
119- ShapeSet, mBoundingRectOrdering);
120- }
121- else
122- {
123- XShapeCombineMask (mDpy, mShapeWindow, ShapeBounding,
124- 0, 0, None, ShapeSet);
125- }
126-
127- if (mBoundingRects)
128- {
129- XFree (mBoundingRects);
130- mBoundingRects = NULL;
131- mNBoundingRects = 0;
132- }
133 }
134
135 XShapeSelectInput (mDpy, mShapeWindow, mShapeMask);
136
137=== modified file 'plugins/unityshell/src/inputremover.h'
138--- plugins/unityshell/src/inputremover.h 2012-04-27 11:42:56 +0000
139+++ plugins/unityshell/src/inputremover.h 2013-02-08 03:07:52 +0000
140@@ -73,9 +73,6 @@
141 int mNInputRects;
142 int mInputRectOrdering;
143
144- XRectangle *mBoundingRects;
145- int mNBoundingRects;
146- int mBoundingRectOrdering;
147 bool mRemoved;
148
149 int mShapeEvent;