Merge lp:~compiz-team/compiz/compiz.revert_3728 into lp:compiz/0.9.10
- compiz.revert_3728
- Merge into 0.9.10
Status: | Merged |
---|---|
Approved by: | Sam Spilsbury |
Approved revision: | 3735 |
Merged at revision: | 3736 |
Proposed branch: | lp:~compiz-team/compiz/compiz.revert_3728 |
Merge into: | lp:compiz/0.9.10 |
Diff against target: |
648 lines (+158/-179) 10 files modified
.bzrignore (+0/-1) plugins/decor/src/decor.cpp (+38/-78) plugins/decor/src/decor.h (+0/-6) plugins/place/src/constrain-to-workarea/include/constrain-to-workarea.h (+6/-3) plugins/place/src/constrain-to-workarea/src/constrain-to-workarea.cpp (+49/-25) plugins/place/src/constrain-to-workarea/tests/constrain-to-workarea/src/test-place-constrain-to-workarea.cpp (+57/-4) plugins/place/src/place.cpp (+8/-3) src/window/extents/src/windowextents.cpp (+0/-10) tests/manual/README.txt (+0/-9) tests/manual/plugins/decor.txt (+0/-40) |
To merge this branch: | bzr merge lp:~compiz-team/compiz/compiz.revert_3728 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
MC Return | Abstain | ||
Brandon Schaefer (community) | Approve | ||
Review via email:
|
Commit message
Revert revision 3278.
Description of the change
Revert revision 3278.
It isn't quite ready yet.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Brandon Schaefer (brandontschaefer) wrote : | # |
Alright, reverting!
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
MC Return (mc-return) wrote : | # |
What about Sam's "It isn't quite ready yet." comment ?
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
MC Return (mc-return) wrote : | # |
Setting to "On Hold"/"WIP" until Sam has verified that this is ready...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Brandon Schaefer (brandontschaefer) wrote : | # |
Hmm I thought he was talking about the branch that was r3278 was not ready, hence why he wanted to revert it?
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
MC Return (mc-return) wrote : | # |
Ah yes, maybe you are right -> I am not sure though...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Brandon Schaefer (brandontschaefer) wrote : | # |
Haha, yeah now im not 100% sure either, soo ill just wait for Sam to come around and global approve it :)
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
MC Return (mc-return) wrote : | # |
+1
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
Approved revid is not set in launchpad (maybe a permission problem?).
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) : | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
MC Return (mc-return) wrote : | # |
Oh, the misunderstanding was on my side. Sorry... ;)
Preview Diff
1 | === removed file '.bzrignore' | |||
2 | --- .bzrignore 2013-05-26 06:01:34 +0000 | |||
3 | +++ .bzrignore 1970-01-01 00:00:00 +0000 | |||
4 | @@ -1,1 +0,0 @@ | |||
5 | 1 | .bzr-repo | ||
6 | 2 | 0 | ||
7 | === modified file 'plugins/decor/src/decor.cpp' | |||
8 | --- plugins/decor/src/decor.cpp 2013-05-20 15:26:11 +0000 | |||
9 | +++ plugins/decor/src/decor.cpp 2013-06-07 06:12:28 +0000 | |||
10 | @@ -1165,8 +1165,6 @@ | |||
11 | 1165 | 1165 | ||
12 | 1166 | xwc.x += w->serverGeometry ().x (); | 1166 | xwc.x += w->serverGeometry ().x (); |
13 | 1167 | xwc.y += w->serverGeometry ().y (); | 1167 | xwc.y += w->serverGeometry ().y (); |
14 | 1168 | xwc.width += w->serverGeometry ().width (); | ||
15 | 1169 | xwc.height += w->serverGeometry ().height (); | ||
16 | 1170 | 1168 | ||
17 | 1171 | w->configureXWindow (mask, &xwc); | 1169 | w->configureXWindow (mask, &xwc); |
18 | 1172 | screen->handleCompizEvent ("decor", "window_decorated", o); | 1170 | screen->handleCompizEvent ("decor", "window_decorated", o); |
19 | @@ -1511,68 +1509,38 @@ | |||
20 | 1511 | 1509 | ||
21 | 1512 | void | 1510 | void |
22 | 1513 | DecorWindow::moveDecoratedWindowBy (const CompPoint &movement, | 1511 | DecorWindow::moveDecoratedWindowBy (const CompPoint &movement, |
23 | 1514 | const CompSize &sizeDelta, | ||
24 | 1515 | bool instant) | 1512 | bool instant) |
25 | 1516 | { | 1513 | { |
45 | 1517 | /* movement and sizeDelta are the shift of the client window | 1514 | /* Need to actually move the window */ |
46 | 1518 | * as a result of decoration from a theoretical neutral position, | 1515 | if (window->placed () && !window->overrideRedirect () && |
47 | 1519 | * lastShift and lastSizeDelta are the last recorded shift | 1516 | (movement.x () || movement.y ())) |
29 | 1520 | * and size-change. The true difference between two decorations | ||
30 | 1521 | * is movement - lastShift, sizeDelta - sizeDelta */ | ||
31 | 1522 | |||
32 | 1523 | int dx = movement.x () - lastShift.x (); | ||
33 | 1524 | int dy = movement.y () - lastShift.y (); | ||
34 | 1525 | int dwidth = sizeDelta.width () - lastSizeDelta.height (); | ||
35 | 1526 | int dheight = sizeDelta.height () - lastSizeDelta.height (); | ||
36 | 1527 | |||
37 | 1528 | /* We don't apply these rules to override-redirect windows | ||
38 | 1529 | * and we need to check that both the position and of the window | ||
39 | 1530 | * would change as a result of decoration in order to move it | ||
40 | 1531 | * (this is usually the case because as a window is decorated | ||
41 | 1532 | * it will necessarily get bigger or smaller in order to fit | ||
42 | 1533 | * inside its decoration) */ | ||
43 | 1534 | if (!window->overrideRedirect () && | ||
44 | 1535 | ((dx || dy) && (dwidth || dheight))) | ||
48 | 1536 | { | 1517 | { |
49 | 1537 | XWindowChanges xwc; | 1518 | XWindowChanges xwc; |
51 | 1538 | unsigned int mask = CWX | CWY | CWWidth | CWHeight; | 1519 | unsigned int mask = CWX | CWY; |
52 | 1539 | 1520 | ||
53 | 1540 | memset (&xwc, 0, sizeof (XWindowChanges)); | 1521 | memset (&xwc, 0, sizeof (XWindowChanges)); |
54 | 1541 | 1522 | ||
55 | 1542 | /* Grab the geometry last sent to server at configureXWindow | 1523 | /* Grab the geometry last sent to server at configureXWindow |
56 | 1543 | * time and not here since serverGeometry may be updated by | 1524 | * time and not here since serverGeometry may be updated by |
57 | 1544 | * the time that we do call configureXWindow */ | 1525 | * the time that we do call configureXWindow */ |
62 | 1545 | xwc.x = dx; | 1526 | xwc.x = movement.x (); |
63 | 1546 | xwc.y = dy; | 1527 | xwc.y = movement.y (); |
60 | 1547 | xwc.width = dwidth; | ||
61 | 1548 | xwc.height = dheight; | ||
64 | 1549 | 1528 | ||
65 | 1550 | /* Except if it's fullscreen, maximized or such */ | 1529 | /* Except if it's fullscreen, maximized or such */ |
66 | 1551 | if (window->state () & CompWindowStateFullscreenMask) | 1530 | if (window->state () & CompWindowStateFullscreenMask) |
68 | 1552 | mask &= ~(CWX | CWY | CWWidth | CWHeight); | 1531 | mask &= ~(CWX | CWY); |
69 | 1553 | 1532 | ||
70 | 1554 | if (window->state () & CompWindowStateMaximizedHorzMask) | 1533 | if (window->state () & CompWindowStateMaximizedHorzMask) |
72 | 1555 | mask &= ~(CWX | CWWidth); | 1534 | mask &= ~CWX; |
73 | 1556 | 1535 | ||
74 | 1557 | if (window->state () & CompWindowStateMaximizedVertMask) | 1536 | if (window->state () & CompWindowStateMaximizedVertMask) |
76 | 1558 | mask &= ~(CWY | CWHeight); | 1537 | mask &= ~CWY; |
77 | 1559 | 1538 | ||
78 | 1560 | if (window->saveMask () & CWX) | 1539 | if (window->saveMask () & CWX) |
80 | 1561 | window->saveWc ().x += xwc.x; | 1540 | window->saveWc ().x += movement.x (); |
81 | 1562 | 1541 | ||
82 | 1563 | if (window->saveMask () & CWY) | 1542 | if (window->saveMask () & CWY) |
95 | 1564 | window->saveWc ().y += xwc.y; | 1543 | window->saveWc ().y += movement.y (); |
84 | 1565 | |||
85 | 1566 | if (window->saveMask () & CWWidth) | ||
86 | 1567 | window->saveWc ().width += xwc.width; | ||
87 | 1568 | |||
88 | 1569 | if (window->saveMask () & CWHeight) | ||
89 | 1570 | window->saveWc ().height += xwc.height; | ||
90 | 1571 | |||
91 | 1572 | /* If the window has not been placed, do not move it this time | ||
92 | 1573 | * but record what we would have moved it by */ | ||
93 | 1574 | if (!window->placed ()) | ||
94 | 1575 | mask = 0; | ||
96 | 1576 | 1544 | ||
97 | 1577 | if (mask) | 1545 | if (mask) |
98 | 1578 | { | 1546 | { |
99 | @@ -1590,15 +1558,6 @@ | |||
100 | 1590 | else | 1558 | else |
101 | 1591 | moveUpdate.start (boost::bind (decorOffsetMove, window, xwc, mask), 0); | 1559 | moveUpdate.start (boost::bind (decorOffsetMove, window, xwc, mask), 0); |
102 | 1592 | } | 1560 | } |
103 | 1593 | |||
104 | 1594 | /* Even if the window has not yet been placed, we still | ||
105 | 1595 | * need to store what we would have moved it by in order | ||
106 | 1596 | * to put it in the right position. The place plugin will | ||
107 | 1597 | * set a position that makes the most sense, but we need | ||
108 | 1598 | * to know how much to move back by should the window | ||
109 | 1599 | * become undecorated again */ | ||
110 | 1600 | lastShift = movement; | ||
111 | 1601 | lastSizeDelta = sizeDelta; | ||
112 | 1602 | } | 1561 | } |
113 | 1603 | } | 1562 | } |
114 | 1604 | 1563 | ||
115 | @@ -1609,9 +1568,9 @@ | |||
116 | 1609 | bool shadowOnly, | 1568 | bool shadowOnly, |
117 | 1610 | bool isSwitcher) | 1569 | bool isSwitcher) |
118 | 1611 | { | 1570 | { |
120 | 1612 | const bool frameOrUnmapReference = (w->frame () || | 1571 | const bool visible = (w->frame () || |
121 | 1613 | w->hasUnmapReference ()); | 1572 | w->hasUnmapReference ()); |
123 | 1614 | const bool realDecoration = frameOrUnmapReference && !shadowOnly; | 1573 | const bool realDecoration = visible && !shadowOnly; |
124 | 1615 | const bool forceDecoration = isSwitcher; | 1574 | const bool forceDecoration = isSwitcher; |
125 | 1616 | 1575 | ||
126 | 1617 | return realDecoration || forceDecoration; | 1576 | return realDecoration || forceDecoration; |
127 | @@ -1657,8 +1616,7 @@ | |||
128 | 1657 | DecorWindow::update (bool allowDecoration) | 1616 | DecorWindow::update (bool allowDecoration) |
129 | 1658 | { | 1617 | { |
130 | 1659 | Decoration::Ptr old, decoration; | 1618 | Decoration::Ptr old, decoration; |
133 | 1660 | CompPoint movement; | 1619 | CompPoint oldShift, movement; |
132 | 1661 | CompSize sizeDelta; | ||
134 | 1662 | 1620 | ||
135 | 1663 | if (wd) | 1621 | if (wd) |
136 | 1664 | old = wd->decor; | 1622 | old = wd->decor; |
137 | @@ -1692,9 +1650,13 @@ | |||
138 | 1692 | if (decoration == old) | 1650 | if (decoration == old) |
139 | 1693 | return false; | 1651 | return false; |
140 | 1694 | 1652 | ||
142 | 1695 | /* Destroy the old WindowDecoration */ | 1653 | /* Determine how much we moved the window for the old |
143 | 1654 | * decoration and save that, also destroy the old | ||
144 | 1655 | * WindowDecoration */ | ||
145 | 1696 | if (old) | 1656 | if (old) |
146 | 1697 | { | 1657 | { |
147 | 1658 | oldShift = cwe::shift (window->border (), window->sizeHints ().win_gravity); | ||
148 | 1659 | |||
149 | 1698 | WindowDecoration::destroy (wd); | 1660 | WindowDecoration::destroy (wd); |
150 | 1699 | wd = NULL; | 1661 | wd = NULL; |
151 | 1700 | } | 1662 | } |
152 | @@ -1716,6 +1678,7 @@ | |||
153 | 1716 | else if (!window->hasUnmapReference ()) | 1678 | else if (!window->hasUnmapReference ()) |
154 | 1717 | window->setWindowFrameExtents (&decoration->border, | 1679 | window->setWindowFrameExtents (&decoration->border, |
155 | 1718 | &decoration->input); | 1680 | &decoration->input); |
156 | 1681 | |||
157 | 1719 | /* This window actually needs its decoration contents updated | 1682 | /* This window actually needs its decoration contents updated |
158 | 1720 | * as it was actually visible */ | 1683 | * as it was actually visible */ |
159 | 1721 | if (decorate || | 1684 | if (decorate || |
160 | @@ -1732,11 +1695,7 @@ | |||
161 | 1732 | } | 1695 | } |
162 | 1733 | 1696 | ||
163 | 1734 | movement = cwe::shift (window->border (), window->sizeHints ().win_gravity); | 1697 | movement = cwe::shift (window->border (), window->sizeHints ().win_gravity); |
169 | 1735 | 1698 | movement -= oldShift; | |
165 | 1736 | sizeDelta = CompSize (-(window->border ().left + | ||
166 | 1737 | window->border ().right), | ||
167 | 1738 | -(window->border ().top + | ||
168 | 1739 | window->border ().bottom)); | ||
170 | 1740 | 1699 | ||
171 | 1741 | window->updateWindowOutputExtents (); | 1700 | window->updateWindowOutputExtents (); |
172 | 1742 | 1701 | ||
173 | @@ -1765,6 +1724,8 @@ | |||
174 | 1765 | memset (&emptyExtents, 0, sizeof (CompWindowExtents)); | 1724 | memset (&emptyExtents, 0, sizeof (CompWindowExtents)); |
175 | 1766 | 1725 | ||
176 | 1767 | window->setWindowFrameExtents (&emptyExtents, &emptyExtents); | 1726 | window->setWindowFrameExtents (&emptyExtents, &emptyExtents); |
177 | 1727 | |||
178 | 1728 | movement -= oldShift; | ||
179 | 1768 | } | 1729 | } |
180 | 1769 | 1730 | ||
181 | 1770 | /* We need to damage the current output extents | 1731 | /* We need to damage the current output extents |
182 | @@ -1778,7 +1739,6 @@ | |||
183 | 1778 | } | 1739 | } |
184 | 1779 | 1740 | ||
185 | 1780 | moveDecoratedWindowBy (movement, | 1741 | moveDecoratedWindowBy (movement, |
186 | 1781 | sizeDelta, | ||
187 | 1782 | !allowDecoration); | 1742 | !allowDecoration); |
188 | 1783 | 1743 | ||
189 | 1784 | return true; | 1744 | return true; |
190 | @@ -2320,20 +2280,6 @@ | |||
191 | 2320 | } | 2280 | } |
192 | 2321 | 2281 | ||
193 | 2322 | /* | 2282 | /* |
194 | 2323 | * DecorWindow::place | ||
195 | 2324 | * | ||
196 | 2325 | * Update any windows just before placement | ||
197 | 2326 | * so that placement algorithms will have the | ||
198 | 2327 | * border size at place-time | ||
199 | 2328 | */ | ||
200 | 2329 | bool | ||
201 | 2330 | DecorWindow::place (CompPoint &pos) | ||
202 | 2331 | { | ||
203 | 2332 | update (true); | ||
204 | 2333 | return window->place (pos); | ||
205 | 2334 | } | ||
206 | 2335 | |||
207 | 2336 | /* | ||
208 | 2337 | * DecorWindow::windowNotify | 2283 | * DecorWindow::windowNotify |
209 | 2338 | * | 2284 | * |
210 | 2339 | * Window event notification handler. On various | 2285 | * Window event notification handler. On various |
211 | @@ -3011,6 +2957,9 @@ | |||
212 | 3011 | { | 2957 | { |
213 | 3012 | if (wd && wd->decor) | 2958 | if (wd && wd->decor) |
214 | 3013 | { | 2959 | { |
215 | 2960 | CompPoint oldShift = compiz::window::extents::shift (window->border (), window->sizeHints ().win_gravity); | ||
216 | 2961 | |||
217 | 2962 | |||
218 | 3014 | if ((window->state () & MAXIMIZE_STATE)) | 2963 | if ((window->state () & MAXIMIZE_STATE)) |
219 | 3015 | window->setWindowFrameExtents (&wd->decor->maxBorder, | 2964 | window->setWindowFrameExtents (&wd->decor->maxBorder, |
220 | 3016 | &wd->decor->maxInput); | 2965 | &wd->decor->maxInput); |
221 | @@ -3018,7 +2967,18 @@ | |||
222 | 3018 | window->setWindowFrameExtents (&wd->decor->border, | 2967 | window->setWindowFrameExtents (&wd->decor->border, |
223 | 3019 | &wd->decor->input); | 2968 | &wd->decor->input); |
224 | 3020 | 2969 | ||
226 | 3021 | /* The shift will occurr in decorOffsetMove */ | 2970 | /* Since we immediately update the frame extents, we must |
227 | 2971 | * also update the stored saved window geometry in order | ||
228 | 2972 | * to prevent the window from shifting back too far once | ||
229 | 2973 | * unmaximized */ | ||
230 | 2974 | |||
231 | 2975 | CompPoint movement = compiz::window::extents::shift (window->border (), window->sizeHints ().win_gravity) - oldShift; | ||
232 | 2976 | |||
233 | 2977 | if (window->saveMask () & CWX) | ||
234 | 2978 | window->saveWc ().x += movement.x (); | ||
235 | 2979 | |||
236 | 2980 | if (window->saveMask () & CWY) | ||
237 | 2981 | window->saveWc ().y += movement.y (); | ||
238 | 3022 | 2982 | ||
239 | 3023 | updateFrame (); | 2983 | updateFrame (); |
240 | 3024 | } | 2984 | } |
241 | 3025 | 2985 | ||
242 | === modified file 'plugins/decor/src/decor.h' | |||
243 | --- plugins/decor/src/decor.h 2013-04-17 23:41:09 +0000 | |||
244 | +++ plugins/decor/src/decor.h 2013-06-07 06:12:28 +0000 | |||
245 | @@ -293,8 +293,6 @@ | |||
246 | 293 | 293 | ||
247 | 294 | bool damageRect (bool, const CompRect &); | 294 | bool damageRect (bool, const CompRect &); |
248 | 295 | 295 | ||
249 | 296 | bool place (CompPoint &pos); | ||
250 | 297 | |||
251 | 298 | bool glDraw (const GLMatrix &, const GLWindowPaintAttrib &, | 296 | bool glDraw (const GLMatrix &, const GLWindowPaintAttrib &, |
252 | 299 | const CompRegion &, unsigned int); | 297 | const CompRegion &, unsigned int); |
253 | 300 | void glDecorate (const GLMatrix &, const GLWindowPaintAttrib &, | 298 | void glDecorate (const GLMatrix &, const GLWindowPaintAttrib &, |
254 | @@ -382,16 +380,12 @@ | |||
255 | 382 | 380 | ||
256 | 383 | X11DecorPixmapRequestor mRequestor; | 381 | X11DecorPixmapRequestor mRequestor; |
257 | 384 | 382 | ||
258 | 385 | CompPoint lastShift; | ||
259 | 386 | CompSize lastSizeDelta; | ||
260 | 387 | |||
261 | 388 | private: | 383 | private: |
262 | 389 | 384 | ||
263 | 390 | bool bareDecorationOnly (); | 385 | bool bareDecorationOnly (); |
264 | 391 | Decoration::Ptr findRealDecoration (); | 386 | Decoration::Ptr findRealDecoration (); |
265 | 392 | Decoration::Ptr findBareDecoration (); | 387 | Decoration::Ptr findBareDecoration (); |
266 | 393 | void moveDecoratedWindowBy (const CompPoint &movement, | 388 | void moveDecoratedWindowBy (const CompPoint &movement, |
267 | 394 | const CompSize &sizeDelta, | ||
268 | 395 | bool instant); | 389 | bool instant); |
269 | 396 | }; | 390 | }; |
270 | 397 | 391 | ||
271 | 398 | 392 | ||
272 | === modified file 'plugins/place/src/constrain-to-workarea/include/constrain-to-workarea.h' | |||
273 | --- plugins/place/src/constrain-to-workarea/include/constrain-to-workarea.h 2013-04-17 23:41:09 +0000 | |||
274 | +++ plugins/place/src/constrain-to-workarea/include/constrain-to-workarea.h 2013-06-07 06:12:28 +0000 | |||
275 | @@ -45,7 +45,8 @@ | |||
276 | 45 | CompPoint & constrainPositionToWorkArea (CompPoint &pos, | 45 | CompPoint & constrainPositionToWorkArea (CompPoint &pos, |
277 | 46 | const compiz::window::Geometry &serverGeometry, | 46 | const compiz::window::Geometry &serverGeometry, |
278 | 47 | const CompWindowExtents &border, | 47 | const CompWindowExtents &border, |
280 | 48 | const CompRect &workArea); | 48 | const CompRect &workArea, |
281 | 49 | bool staticGravity); | ||
282 | 49 | 50 | ||
283 | 50 | 51 | ||
284 | 51 | CompPoint getViewportRelativeCoordinates (const compiz::window::Geometry &geom, | 52 | CompPoint getViewportRelativeCoordinates (const compiz::window::Geometry &geom, |
285 | @@ -53,7 +54,8 @@ | |||
286 | 53 | 54 | ||
287 | 54 | CompWindowExtents getWindowEdgePositions (const CompPoint &position, | 55 | CompWindowExtents getWindowEdgePositions (const CompPoint &position, |
288 | 55 | const compiz::window::Geometry &geom, | 56 | const compiz::window::Geometry &geom, |
290 | 56 | const CompWindowExtents &border); | 57 | const CompWindowExtents &border, |
291 | 58 | unsigned int gravity); | ||
292 | 57 | 59 | ||
293 | 58 | void clampHorizontalEdgePositionsToWorkArea (CompWindowExtents &edgePositions, | 60 | void clampHorizontalEdgePositionsToWorkArea (CompWindowExtents &edgePositions, |
294 | 59 | const CompRect &workArea); | 61 | const CompRect &workArea); |
295 | @@ -62,7 +64,8 @@ | |||
296 | 62 | 64 | ||
297 | 63 | void subtractBordersFromEdgePositions (CompWindowExtents &edgePositions, | 65 | void subtractBordersFromEdgePositions (CompWindowExtents &edgePositions, |
298 | 64 | const CompWindowExtents &border, | 66 | const CompWindowExtents &border, |
300 | 65 | unsigned int legacyBorder); | 67 | unsigned int legacyBorder, |
301 | 68 | unsigned int gravity); | ||
302 | 66 | 69 | ||
303 | 67 | bool onlySizeChanged (unsigned int mask); | 70 | bool onlySizeChanged (unsigned int mask); |
304 | 68 | bool applyWidthChange (const CompWindowExtents &edgePositions, | 71 | bool applyWidthChange (const CompWindowExtents &edgePositions, |
305 | 69 | 72 | ||
306 | === modified file 'plugins/place/src/constrain-to-workarea/src/constrain-to-workarea.cpp' | |||
307 | --- plugins/place/src/constrain-to-workarea/src/constrain-to-workarea.cpp 2013-04-17 23:41:09 +0000 | |||
308 | +++ plugins/place/src/constrain-to-workarea/src/constrain-to-workarea.cpp 2013-06-07 06:12:28 +0000 | |||
309 | @@ -140,21 +140,35 @@ | |||
310 | 140 | 140 | ||
311 | 141 | CompPoint & | 141 | CompPoint & |
312 | 142 | cp::constrainPositionToWorkArea (CompPoint &pos, | 142 | cp::constrainPositionToWorkArea (CompPoint &pos, |
316 | 143 | const cw::Geometry &serverGeometry, | 143 | const cw::Geometry &serverGeometry, |
317 | 144 | const CompWindowExtents &border, | 144 | const CompWindowExtents &border, |
318 | 145 | const CompRect &workArea) | 145 | const CompRect &workArea, |
319 | 146 | bool staticGravity) | ||
320 | 146 | { | 147 | { |
321 | 147 | CompWindowExtents extents; | 148 | CompWindowExtents extents; |
322 | 148 | int delta; | 149 | int delta; |
323 | 149 | 150 | ||
326 | 150 | extents.left = pos.x () - border.left; | 151 | CompWindowExtents effectiveBorders = border; |
327 | 151 | extents.top = pos.y () - border.top; | 152 | |
328 | 153 | /* Ignore borders in the StaticGravity case for placement | ||
329 | 154 | * because the window intended to be placed as if it didn't | ||
330 | 155 | * have them */ | ||
331 | 156 | if (staticGravity) | ||
332 | 157 | { | ||
333 | 158 | effectiveBorders.left = 0; | ||
334 | 159 | effectiveBorders.right = 0; | ||
335 | 160 | effectiveBorders.top = 0; | ||
336 | 161 | effectiveBorders.bottom = 0; | ||
337 | 162 | } | ||
338 | 163 | |||
339 | 164 | extents.left = pos.x () - effectiveBorders.left; | ||
340 | 165 | extents.top = pos.y () - effectiveBorders.top; | ||
341 | 152 | extents.right = extents.left + serverGeometry.widthIncBorders () + | 166 | extents.right = extents.left + serverGeometry.widthIncBorders () + |
344 | 153 | (border.left + | 167 | (effectiveBorders.left + |
345 | 154 | border.right); | 168 | effectiveBorders.right); |
346 | 155 | extents.bottom = extents.top + serverGeometry.heightIncBorders () + | 169 | extents.bottom = extents.top + serverGeometry.heightIncBorders () + |
349 | 156 | (border.top + | 170 | (effectiveBorders.top + |
350 | 157 | border.bottom); | 171 | effectiveBorders.bottom); |
351 | 158 | 172 | ||
352 | 159 | delta = workArea.right () - extents.right; | 173 | delta = workArea.right () - extents.right; |
353 | 160 | if (delta < 0) | 174 | if (delta < 0) |
354 | @@ -172,8 +186,8 @@ | |||
355 | 172 | if (delta > 0) | 186 | if (delta > 0) |
356 | 173 | extents.top += delta; | 187 | extents.top += delta; |
357 | 174 | 188 | ||
360 | 175 | pos.setX (extents.left + border.left); | 189 | pos.setX (extents.left + effectiveBorders.left); |
361 | 176 | pos.setY (extents.top + border.top); | 190 | pos.setY (extents.top + effectiveBorders.top); |
362 | 177 | 191 | ||
363 | 178 | return pos; | 192 | return pos; |
364 | 179 | } | 193 | } |
365 | @@ -199,18 +213,23 @@ | |||
366 | 199 | 213 | ||
367 | 200 | CompWindowExtents cp::getWindowEdgePositions (const CompPoint &position, | 214 | CompWindowExtents cp::getWindowEdgePositions (const CompPoint &position, |
368 | 201 | const cw::Geometry &geom, | 215 | const cw::Geometry &geom, |
370 | 202 | const CompWindowExtents &border) | 216 | const CompWindowExtents &border, |
371 | 217 | unsigned int gravity) | ||
372 | 203 | { | 218 | { |
373 | 204 | CompWindowExtents edgePositions; | 219 | CompWindowExtents edgePositions; |
376 | 205 | 220 | CompWindowExtents effectiveBorder (border); | |
377 | 206 | edgePositions.left = position.x () - border.left; | 221 | |
378 | 222 | if (gravity & StaticGravity) | ||
379 | 223 | effectiveBorder = CompWindowExtents (0, 0, 0, 0); | ||
380 | 224 | |||
381 | 225 | edgePositions.left = position.x () - effectiveBorder.left; | ||
382 | 207 | edgePositions.right = edgePositions.left + | 226 | edgePositions.right = edgePositions.left + |
386 | 208 | geom.widthIncBorders () + (border.left + | 227 | geom.widthIncBorders () + (effectiveBorder.left + |
387 | 209 | border.right); | 228 | effectiveBorder.right); |
388 | 210 | edgePositions.top = position.y () - border.top; | 229 | edgePositions.top = position.y () - effectiveBorder.top; |
389 | 211 | edgePositions.bottom = edgePositions.top + | 230 | edgePositions.bottom = edgePositions.top + |
392 | 212 | geom.heightIncBorders () + (border.top + | 231 | geom.heightIncBorders () + (effectiveBorder.top + |
393 | 213 | border.bottom); | 232 | effectiveBorder.bottom); |
394 | 214 | 233 | ||
395 | 215 | return edgePositions; | 234 | return edgePositions; |
396 | 216 | } | 235 | } |
397 | @@ -266,14 +285,19 @@ | |||
398 | 266 | 285 | ||
399 | 267 | void cp::subtractBordersFromEdgePositions (CompWindowExtents &edgePositions, | 286 | void cp::subtractBordersFromEdgePositions (CompWindowExtents &edgePositions, |
400 | 268 | const CompWindowExtents &border, | 287 | const CompWindowExtents &border, |
402 | 269 | unsigned int legacyBorder) | 288 | unsigned int legacyBorder, |
403 | 289 | unsigned int gravity) | ||
404 | 270 | { | 290 | { |
405 | 271 | const unsigned int doubleBorder = 2 * legacyBorder; | 291 | const unsigned int doubleBorder = 2 * legacyBorder; |
411 | 272 | 292 | CompWindowExtents effectiveBorder = border; | |
412 | 273 | edgePositions.left += border.left; | 293 | |
413 | 274 | edgePositions.right -= border.right + doubleBorder; | 294 | if (gravity & StaticGravity) |
414 | 275 | edgePositions.top += border.top; | 295 | effectiveBorder = CompWindowExtents (0, 0, 0, 0); |
415 | 276 | edgePositions.bottom -= border.bottom + doubleBorder; | 296 | |
416 | 297 | edgePositions.left += effectiveBorder.left; | ||
417 | 298 | edgePositions.right -= effectiveBorder.right + doubleBorder; | ||
418 | 299 | edgePositions.top += effectiveBorder.top; | ||
419 | 300 | edgePositions.bottom -= effectiveBorder.bottom + doubleBorder; | ||
420 | 277 | } | 301 | } |
421 | 278 | 302 | ||
422 | 279 | bool cp::onlySizeChanged (unsigned int mask) | 303 | bool cp::onlySizeChanged (unsigned int mask) |
423 | 280 | 304 | ||
424 | === modified file 'plugins/place/src/constrain-to-workarea/tests/constrain-to-workarea/src/test-place-constrain-to-workarea.cpp' | |||
425 | --- plugins/place/src/constrain-to-workarea/tests/constrain-to-workarea/src/test-place-constrain-to-workarea.cpp 2013-04-17 23:41:09 +0000 | |||
426 | +++ plugins/place/src/constrain-to-workarea/tests/constrain-to-workarea/src/test-place-constrain-to-workarea.cpp 2013-06-07 06:12:28 +0000 | |||
427 | @@ -226,7 +226,7 @@ | |||
428 | 226 | extents = WindowExtents (GetParam ()); | 226 | extents = WindowExtents (GetParam ()); |
429 | 227 | 227 | ||
430 | 228 | CompPoint pos = InitialPosition (GetParam ()); | 228 | CompPoint pos = InitialPosition (GetParam ()); |
432 | 229 | pos = cp::constrainPositionToWorkArea (pos, g, extents, WArea); | 229 | pos = cp::constrainPositionToWorkArea (pos, g, extents, WArea, false); |
433 | 230 | 230 | ||
434 | 231 | const CompPoint expectedAfterExtentsAdjustment = ExpectedPosition + | 231 | const CompPoint expectedAfterExtentsAdjustment = ExpectedPosition + |
435 | 232 | CompPoint (extents.left, | 232 | CompPoint (extents.left, |
436 | @@ -235,6 +235,19 @@ | |||
437 | 235 | EXPECT_EQ (expectedAfterExtentsAdjustment, pos); | 235 | EXPECT_EQ (expectedAfterExtentsAdjustment, pos); |
438 | 236 | } | 236 | } |
439 | 237 | 237 | ||
440 | 238 | TEST_P (PlaceConstrainPositionToWorkArea, PositionConstrainedStaticGravity) | ||
441 | 239 | { | ||
442 | 240 | g = WindowGeometry (GetParam ()); | ||
443 | 241 | extents = WindowExtents (GetParam ()); | ||
444 | 242 | |||
445 | 243 | CompPoint pos = InitialPosition (GetParam ()); | ||
446 | 244 | pos = cp::constrainPositionToWorkArea (pos, g, extents, WArea, true); | ||
447 | 245 | |||
448 | 246 | /* Do not adjust residual position for extents with windows | ||
449 | 247 | * that have a static gravity */ | ||
450 | 248 | EXPECT_EQ (ExpectedPosition, pos); | ||
451 | 249 | } | ||
452 | 250 | |||
453 | 238 | namespace | 251 | namespace |
454 | 239 | { | 252 | { |
455 | 240 | cwe::Extents PossibleExtents[] = | 253 | cwe::Extents PossibleExtents[] = |
456 | @@ -284,7 +297,7 @@ | |||
457 | 284 | CompPoint pos; | 297 | CompPoint pos; |
458 | 285 | }; | 298 | }; |
459 | 286 | 299 | ||
461 | 287 | TEST_F (PlaceGetEdgePositions, GetEdgePositions) | 300 | TEST_F (PlaceGetEdgePositions, GetEdgePositionsNWGravity) |
462 | 288 | { | 301 | { |
463 | 289 | int left = geom.x () - border.left; | 302 | int left = geom.x () - border.left; |
464 | 290 | int right = left + (geom.widthIncBorders ()) + | 303 | int right = left + (geom.widthIncBorders ()) + |
465 | @@ -296,7 +309,25 @@ | |||
466 | 296 | const cwe::Extents ExpectedExtents (left, right, top, bottom); | 309 | const cwe::Extents ExpectedExtents (left, right, top, bottom); |
467 | 297 | cwe::Extents actualExtents (cp::getWindowEdgePositions (pos, | 310 | cwe::Extents actualExtents (cp::getWindowEdgePositions (pos, |
468 | 298 | geom, | 311 | geom, |
470 | 299 | border)); | 312 | border, |
471 | 313 | NorthWestGravity)); | ||
472 | 314 | |||
473 | 315 | EXPECT_EQ (ExpectedExtents, actualExtents); | ||
474 | 316 | } | ||
475 | 317 | |||
476 | 318 | TEST_F (PlaceGetEdgePositions, GetEdgePositionsStaticGravity) | ||
477 | 319 | { | ||
478 | 320 | /* Don't count borders in validation */ | ||
479 | 321 | int left = geom.x (); | ||
480 | 322 | int right = left + (geom.widthIncBorders ()); | ||
481 | 323 | int top = geom.y (); | ||
482 | 324 | int bottom = top + (geom.heightIncBorders ()); | ||
483 | 325 | |||
484 | 326 | const cwe::Extents ExpectedExtents (left, right, top, bottom); | ||
485 | 327 | cwe::Extents actualExtents (cp::getWindowEdgePositions (pos, | ||
486 | 328 | geom, | ||
487 | 329 | border, | ||
488 | 330 | StaticGravity)); | ||
489 | 300 | 331 | ||
490 | 301 | EXPECT_EQ (ExpectedExtents, actualExtents); | 332 | EXPECT_EQ (ExpectedExtents, actualExtents); |
491 | 302 | } | 333 | } |
492 | @@ -496,7 +527,29 @@ | |||
493 | 496 | 527 | ||
494 | 497 | cp::subtractBordersFromEdgePositions (modifiedEdgePositions, | 528 | cp::subtractBordersFromEdgePositions (modifiedEdgePositions, |
495 | 498 | borders, | 529 | borders, |
497 | 499 | legacyBorder); | 530 | legacyBorder, |
498 | 531 | NorthWestGravity); | ||
499 | 532 | |||
500 | 533 | EXPECT_EQ (expectedEdgePositions, modifiedEdgePositions); | ||
501 | 534 | } | ||
502 | 535 | |||
503 | 536 | TEST (PlaceSubtractBordersFromEdgePositions, StaticGravityDefinition) | ||
504 | 537 | { | ||
505 | 538 | const CompWindowExtents borders (1, 2, 3, 4); | ||
506 | 539 | const CompWindowExtents edgePositions (100, 200, 100, 200); | ||
507 | 540 | const unsigned int legacyBorder = 1; | ||
508 | 541 | |||
509 | 542 | CompWindowExtents expectedEdgePositions (edgePositions.left, | ||
510 | 543 | edgePositions.right - (2 * legacyBorder), | ||
511 | 544 | edgePositions.top, | ||
512 | 545 | edgePositions.bottom - (2 * legacyBorder)); | ||
513 | 546 | |||
514 | 547 | CompWindowExtents modifiedEdgePositions (edgePositions); | ||
515 | 548 | |||
516 | 549 | cp::subtractBordersFromEdgePositions (modifiedEdgePositions, | ||
517 | 550 | borders, | ||
518 | 551 | legacyBorder, | ||
519 | 552 | StaticGravity); | ||
520 | 500 | 553 | ||
521 | 501 | EXPECT_EQ (expectedEdgePositions, modifiedEdgePositions); | 554 | EXPECT_EQ (expectedEdgePositions, modifiedEdgePositions); |
522 | 502 | } | 555 | } |
523 | 503 | 556 | ||
524 | === modified file 'plugins/place/src/place.cpp' | |||
525 | --- plugins/place/src/place.cpp 2013-05-20 15:26:11 +0000 | |||
526 | +++ plugins/place/src/place.cpp 2013-06-07 06:12:28 +0000 | |||
527 | @@ -362,7 +362,8 @@ | |||
528 | 362 | 362 | ||
529 | 363 | CompWindowExtents edgePositions = cp::getWindowEdgePositions (pos, | 363 | CompWindowExtents edgePositions = cp::getWindowEdgePositions (pos, |
530 | 364 | geom, | 364 | geom, |
532 | 365 | window->border ()); | 365 | window->border (), |
533 | 366 | window->sizeHints ().win_gravity); | ||
534 | 366 | 367 | ||
535 | 367 | int output = screen->outputDeviceForGeometry (geom); | 368 | int output = screen->outputDeviceForGeometry (geom); |
536 | 368 | CompRect workArea = screen->getWorkareaForOutput (output); | 369 | CompRect workArea = screen->getWorkareaForOutput (output); |
537 | @@ -385,7 +386,8 @@ | |||
538 | 385 | /* bring left/right/top/bottom to actual window coordinates */ | 386 | /* bring left/right/top/bottom to actual window coordinates */ |
539 | 386 | cp::subtractBordersFromEdgePositions (edgePositions, | 387 | cp::subtractBordersFromEdgePositions (edgePositions, |
540 | 387 | window->border (), | 388 | window->border (), |
542 | 388 | geom.border ()); | 389 | geom.border (), |
543 | 390 | window->sizeHints ().win_gravity); | ||
544 | 389 | 391 | ||
545 | 390 | /* always validate position if the application changed only its size, | 392 | /* always validate position if the application changed only its size, |
546 | 391 | * as it might become partially offscreen because of that */ | 393 | * as it might become partially offscreen because of that */ |
547 | @@ -1141,10 +1143,13 @@ | |||
548 | 1141 | PlaceWindow::constrainToWorkarea (const CompRect &workArea, | 1143 | PlaceWindow::constrainToWorkarea (const CompRect &workArea, |
549 | 1142 | CompPoint &pos) | 1144 | CompPoint &pos) |
550 | 1143 | { | 1145 | { |
551 | 1146 | bool staticGravity = window->sizeHints ().win_gravity & StaticGravity; | ||
552 | 1147 | |||
553 | 1144 | pos = cp::constrainPositionToWorkArea (pos, | 1148 | pos = cp::constrainPositionToWorkArea (pos, |
554 | 1145 | window->serverGeometry (), | 1149 | window->serverGeometry (), |
555 | 1146 | window->border (), | 1150 | window->border (), |
557 | 1147 | workArea); | 1151 | workArea, |
558 | 1152 | staticGravity); | ||
559 | 1148 | 1153 | ||
560 | 1149 | } | 1154 | } |
561 | 1150 | 1155 | ||
562 | 1151 | 1156 | ||
563 | === modified file 'src/window/extents/src/windowextents.cpp' | |||
564 | --- src/window/extents/src/windowextents.cpp 2013-04-17 23:41:09 +0000 | |||
565 | +++ src/window/extents/src/windowextents.cpp 2013-06-07 06:12:28 +0000 | |||
566 | @@ -35,11 +35,6 @@ | |||
567 | 35 | CompPoint rv = CompPoint (); | 35 | CompPoint rv = CompPoint (); |
568 | 36 | 36 | ||
569 | 37 | switch (gravity) { | 37 | switch (gravity) { |
570 | 38 | /* We treat StaticGravity like NorthWestGravity here | ||
571 | 39 | * as when decorating / undecorating the window we | ||
572 | 40 | * really do need to move it in order to handle | ||
573 | 41 | * any cases where it goes offscreen */ | ||
574 | 42 | case StaticGravity: | ||
575 | 43 | case NorthGravity: | 38 | case NorthGravity: |
576 | 44 | case NorthWestGravity: | 39 | case NorthWestGravity: |
577 | 45 | case NorthEastGravity: | 40 | case NorthEastGravity: |
578 | @@ -55,11 +50,6 @@ | |||
579 | 55 | } | 50 | } |
580 | 56 | 51 | ||
581 | 57 | switch (gravity) { | 52 | switch (gravity) { |
582 | 58 | /* We treat StaticGravity like NorthWestGravity here | ||
583 | 59 | * as when decorating / undecorating the window we | ||
584 | 60 | * really do need to move it in order to handle | ||
585 | 61 | * any cases where it goes offscreen */ | ||
586 | 62 | case StaticGravity: | ||
587 | 63 | case WestGravity: | 53 | case WestGravity: |
588 | 64 | case NorthWestGravity: | 54 | case NorthWestGravity: |
589 | 65 | case SouthWestGravity: | 55 | case SouthWestGravity: |
590 | 66 | 56 | ||
591 | === removed file 'tests/manual/README.txt' | |||
592 | --- tests/manual/README.txt 2013-04-18 03:02:14 +0000 | |||
593 | +++ tests/manual/README.txt 1970-01-01 00:00:00 +0000 | |||
594 | @@ -1,9 +0,0 @@ | |||
595 | 1 | Compiz Manual Tests | ||
596 | 2 | =================== | ||
597 | 3 | |||
598 | 4 | Avoid writing manual tests if you can. Acceptance tests that can be run | ||
599 | 5 | on an automatic basis are always preferred. | ||
600 | 6 | |||
601 | 7 | If getting some part of the code would be too difficult or invasive, then | ||
602 | 8 | write a manual test in here so that we can remind ourselves to deploy test | ||
603 | 9 | frameworks for the code in quesiton. | ||
604 | 10 | 0 | ||
605 | === removed file 'tests/manual/plugins/decor.txt' | |||
606 | --- tests/manual/plugins/decor.txt 2013-05-20 15:26:11 +0000 | |||
607 | +++ tests/manual/plugins/decor.txt 1970-01-01 00:00:00 +0000 | |||
608 | @@ -1,40 +0,0 @@ | |||
609 | 1 | COMPIZ DECOR PLUGIN | ||
610 | 2 | =================== | ||
611 | 3 | Sam Spilsbury <smspillaz@gmail.com> | ||
612 | 4 | |||
613 | 5 | Static Gravity Handling - no decorations | ||
614 | 6 | ---------------------------------------- | ||
615 | 7 | Setup: | ||
616 | 8 | # Install guake | ||
617 | 9 | |||
618 | 10 | Actions: | ||
619 | 11 | # Start and launch guake | ||
620 | 12 | |||
621 | 13 | Expected Result: | ||
622 | 14 | Guake should sit flush with the panels and work area | ||
623 | 15 | |||
624 | 16 | Static Gravity Handling - decorations | ||
625 | 17 | ------------------------------------- | ||
626 | 18 | Setup: | ||
627 | 19 | # Install friends-app | ||
628 | 20 | |||
629 | 21 | Actions: | ||
630 | 22 | # Start and launch friends-app | ||
631 | 23 | |||
632 | 24 | Expected Result: | ||
633 | 25 | The QML window should have its decorations visible and | ||
634 | 26 | be contained in the top left hand corner of the work area | ||
635 | 27 | |||
636 | 28 | _NET_REQUEST_FRAME_EXTENTS handling | ||
637 | 29 | ----------------------------------- | ||
638 | 30 | Setup: | ||
639 | 31 | # Install any sun-awt application - examples: | ||
640 | 32 | 1. netbeans | ||
641 | 33 | 2. ecplise | ||
642 | 34 | |||
643 | 35 | Actions: | ||
644 | 36 | # Run the application | ||
645 | 37 | |||
646 | 38 | Expected Result: | ||
647 | 39 | The application should not have its contents offset | ||
648 | 40 | by its decoration size |
PASSED: Continuous integration, rev:3735 jenkins. qa.ubuntu. com/job/ compiz- ci/193/ jenkins. qa.ubuntu. com/job/ compiz- gles-ci/ ./build= pbuilder, distribution= raring, flavor= amd64/234 jenkins. qa.ubuntu. com/job/ compiz- saucy-amd64- ci/6 jenkins. qa.ubuntu. com/job/ compiz- saucy-armhf- ci/6 jenkins. qa.ubuntu. com/job/ compiz- saucy-i386- ci/6
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins: 8080/job/ compiz- ci/193/ rebuild
http://