Merge lp:~mterry/compiz/unmaximize-regression into lp:compiz/raring
- unmaximize-regression
- Merge into raring
Status: | Merged |
---|---|
Approved by: | Łukasz Zemczak |
Approved revision: | 3639 |
Merged at revision: | 3639 |
Proposed branch: | lp:~mterry/compiz/unmaximize-regression |
Merge into: | lp:compiz/raring |
Diff against target: |
472 lines (+216/-150) 2 files modified
plugins/decor/src/decor.cpp (+201/-150) plugins/decor/src/decor.h (+15/-0) |
To merge this branch: | bzr merge lp:~mterry/compiz/unmaximize-regression |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
Łukasz Zemczak | Approve | ||
Review via email: mp+154994@code.launchpad.net |
Commit message
Also decorate shadow-only windows. Strangely this fixes (LP: #1158161)
Description of the change
This fixes a regression; it is also landing in trunk.
It does cause a small regression with window size of some undecorated windows (notably, the workrave "rest break warning" window). We'll deal with that separately, since it's a less severe-regression than the one this fixes.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:3639
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) : | # |
Preview Diff
1 | === modified file 'plugins/decor/src/decor.cpp' | |||
2 | --- plugins/decor/src/decor.cpp 2013-03-11 06:45:19 +0000 | |||
3 | +++ plugins/decor/src/decor.cpp 2013-03-22 16:49:24 +0000 | |||
4 | @@ -42,6 +42,8 @@ | |||
5 | 42 | 42 | ||
6 | 43 | COMPIZ_PLUGIN_20090315 (decor, DecorPluginVTable) | 43 | COMPIZ_PLUGIN_20090315 (decor, DecorPluginVTable) |
7 | 44 | 44 | ||
8 | 45 | namespace cwe = compiz::window::extents; | ||
9 | 46 | |||
10 | 45 | MatchedDecorClipGroup::MatchedDecorClipGroup (const CompMatch &match) : | 47 | MatchedDecorClipGroup::MatchedDecorClipGroup (const CompMatch &match) : |
11 | 46 | mMatch (match) | 48 | mMatch (match) |
12 | 47 | { | 49 | { |
13 | @@ -1399,6 +1401,181 @@ | |||
14 | 1399 | return *cit; | 1401 | return *cit; |
15 | 1400 | } | 1402 | } |
16 | 1401 | 1403 | ||
17 | 1404 | bool | ||
18 | 1405 | DecorWindow::bareDecorationOnly () | ||
19 | 1406 | { | ||
20 | 1407 | bool shadowOnly = true; | ||
21 | 1408 | /* Only want to decorate windows which have a frame or are in the process | ||
22 | 1409 | * of waiting for an animation to be unmapped (in which case we can give | ||
23 | 1410 | * them a new pixmap type frame since we don't actually need an input | ||
24 | 1411 | * window to go along with that | ||
25 | 1412 | * | ||
26 | 1413 | * FIXME: That's not going to play nice with reparented decorations in core | ||
27 | 1414 | * since the window gets reparented right away before plugins are done | ||
28 | 1415 | * with it */ | ||
29 | 1416 | |||
30 | 1417 | /* Unconditionally decorate switchers */ | ||
31 | 1418 | if (!isSwitcher) | ||
32 | 1419 | { | ||
33 | 1420 | switch (window->type ()) { | ||
34 | 1421 | case CompWindowTypeDialogMask: | ||
35 | 1422 | case CompWindowTypeModalDialogMask: | ||
36 | 1423 | case CompWindowTypeUtilMask: | ||
37 | 1424 | case CompWindowTypeMenuMask: | ||
38 | 1425 | case CompWindowTypeNormalMask: | ||
39 | 1426 | if (window->mwmDecor () & (MwmDecorAll | MwmDecorTitle)) | ||
40 | 1427 | shadowOnly = false; | ||
41 | 1428 | default: | ||
42 | 1429 | break; | ||
43 | 1430 | } | ||
44 | 1431 | |||
45 | 1432 | if (window->overrideRedirect ()) | ||
46 | 1433 | shadowOnly = true; | ||
47 | 1434 | |||
48 | 1435 | if (window->wmType () & (CompWindowTypeDockMask | CompWindowTypeDesktopMask)) | ||
49 | 1436 | shadowOnly = true; | ||
50 | 1437 | |||
51 | 1438 | if (!shadowOnly) | ||
52 | 1439 | { | ||
53 | 1440 | if (!dScreen->optionGetDecorationMatch ().evaluate (window)) | ||
54 | 1441 | shadowOnly = true; | ||
55 | 1442 | } | ||
56 | 1443 | |||
57 | 1444 | /* Never on unmapped windows */ | ||
58 | 1445 | if (!window->isViewable ()) | ||
59 | 1446 | shadowOnly = false; | ||
60 | 1447 | } | ||
61 | 1448 | else | ||
62 | 1449 | shadowOnly = false; | ||
63 | 1450 | |||
64 | 1451 | return shadowOnly; | ||
65 | 1452 | } | ||
66 | 1453 | |||
67 | 1454 | Decoration::Ptr | ||
68 | 1455 | DecorWindow::findRealDecoration () | ||
69 | 1456 | { | ||
70 | 1457 | Decoration::Ptr decoration; | ||
71 | 1458 | |||
72 | 1459 | /* Attempt to find a matching decoration */ | ||
73 | 1460 | try | ||
74 | 1461 | { | ||
75 | 1462 | decoration = decor.findMatchingDecoration (window, true); | ||
76 | 1463 | } | ||
77 | 1464 | catch (...) | ||
78 | 1465 | { | ||
79 | 1466 | /* Find an appropriate default decoration to use */ | ||
80 | 1467 | if (dScreen->dmSupports & WINDOW_DECORATION_TYPE_PIXMAP && | ||
81 | 1468 | dScreen->cmActive && | ||
82 | 1469 | !(dScreen->dmSupports & WINDOW_DECORATION_TYPE_WINDOW && | ||
83 | 1470 | pixmapFailed)) | ||
84 | 1471 | { | ||
85 | 1472 | try | ||
86 | 1473 | { | ||
87 | 1474 | decoration = dScreen->decor[DECOR_ACTIVE].findMatchingDecoration (window, false); | ||
88 | 1475 | } | ||
89 | 1476 | catch (...) | ||
90 | 1477 | { | ||
91 | 1478 | compLogMessage ("decor", CompLogLevelWarn, "No default decoration found, placement will not be correct"); | ||
92 | 1479 | decoration.reset (); | ||
93 | 1480 | } | ||
94 | 1481 | } | ||
95 | 1482 | else if (dScreen->dmSupports & WINDOW_DECORATION_TYPE_WINDOW) | ||
96 | 1483 | decoration = dScreen->windowDefault; | ||
97 | 1484 | } | ||
98 | 1485 | |||
99 | 1486 | return decoration; | ||
100 | 1487 | } | ||
101 | 1488 | |||
102 | 1489 | Decoration::Ptr | ||
103 | 1490 | DecorWindow::findBareDecoration () | ||
104 | 1491 | { | ||
105 | 1492 | Decoration::Ptr decoration; | ||
106 | 1493 | /* This window isn't "decorated" but it still gets a shadow as long | ||
107 | 1494 | * as it isn't shaped weirdly, since the shadow is just a quad rect */ | ||
108 | 1495 | if (dScreen->optionGetShadowMatch ().evaluate (window)) | ||
109 | 1496 | { | ||
110 | 1497 | if (window->region ().numRects () == 1 && !window->alpha () && dScreen->decor[DECOR_BARE].mList.size ()) | ||
111 | 1498 | decoration = dScreen->decor[DECOR_BARE].mList.front (); | ||
112 | 1499 | |||
113 | 1500 | if (decoration) | ||
114 | 1501 | { | ||
115 | 1502 | if (!checkSize (decoration)) | ||
116 | 1503 | decoration.reset (); | ||
117 | 1504 | } | ||
118 | 1505 | } | ||
119 | 1506 | |||
120 | 1507 | return decoration; | ||
121 | 1508 | } | ||
122 | 1509 | |||
123 | 1510 | void | ||
124 | 1511 | DecorWindow::moveDecoratedWindowBy (const CompPoint &movement, | ||
125 | 1512 | bool instant) | ||
126 | 1513 | { | ||
127 | 1514 | /* Need to actually move the window */ | ||
128 | 1515 | if (window->placed () && !window->overrideRedirect () && | ||
129 | 1516 | (movement.x () || movement.y ())) | ||
130 | 1517 | { | ||
131 | 1518 | XWindowChanges xwc; | ||
132 | 1519 | unsigned int mask = CWX | CWY; | ||
133 | 1520 | |||
134 | 1521 | memset (&xwc, 0, sizeof (XWindowChanges)); | ||
135 | 1522 | |||
136 | 1523 | /* Grab the geometry last sent to server at configureXWindow | ||
137 | 1524 | * time and not here since serverGeometry may be updated by | ||
138 | 1525 | * the time that we do call configureXWindow */ | ||
139 | 1526 | xwc.x = movement.x (); | ||
140 | 1527 | xwc.y = movement.y (); | ||
141 | 1528 | |||
142 | 1529 | /* Except if it's fullscreen, maximized or such */ | ||
143 | 1530 | if (window->state () & CompWindowStateFullscreenMask) | ||
144 | 1531 | mask &= ~(CWX | CWY); | ||
145 | 1532 | |||
146 | 1533 | if (window->state () & CompWindowStateMaximizedHorzMask) | ||
147 | 1534 | mask &= ~CWX; | ||
148 | 1535 | |||
149 | 1536 | if (window->state () & CompWindowStateMaximizedVertMask) | ||
150 | 1537 | mask &= ~CWY; | ||
151 | 1538 | |||
152 | 1539 | if (window->saveMask () & CWX) | ||
153 | 1540 | window->saveWc ().x += movement.x (); | ||
154 | 1541 | |||
155 | 1542 | if (window->saveMask () & CWY) | ||
156 | 1543 | window->saveWc ().y += movement.y (); | ||
157 | 1544 | |||
158 | 1545 | if (mask) | ||
159 | 1546 | { | ||
160 | 1547 | /* instant is only true in the case of | ||
161 | 1548 | * the destructor calling the update function so since it | ||
162 | 1549 | * is not safe to put the function in a timer (since | ||
163 | 1550 | * it will get unref'd on the vtable destruction) we | ||
164 | 1551 | * need to do it immediately | ||
165 | 1552 | * | ||
166 | 1553 | * FIXME: CompTimer should really be PIMPL and allow | ||
167 | 1554 | * refcounting in case we need to keep it alive | ||
168 | 1555 | */ | ||
169 | 1556 | if (instant) | ||
170 | 1557 | decorOffsetMove (window, xwc, mask); | ||
171 | 1558 | else | ||
172 | 1559 | moveUpdate.start (boost::bind (decorOffsetMove, window, xwc, mask), 0); | ||
173 | 1560 | } | ||
174 | 1561 | } | ||
175 | 1562 | } | ||
176 | 1563 | |||
177 | 1564 | namespace | ||
178 | 1565 | { | ||
179 | 1566 | bool | ||
180 | 1567 | shouldDecorateWindow (CompWindow *w, | ||
181 | 1568 | bool shadowOnly, | ||
182 | 1569 | bool isSwitcher) | ||
183 | 1570 | { | ||
184 | 1571 | const bool visible = (w->frame () || | ||
185 | 1572 | w->hasUnmapReference ()); | ||
186 | 1573 | const bool realDecoration = visible && !shadowOnly; | ||
187 | 1574 | const bool forceDecoration = isSwitcher; | ||
188 | 1575 | |||
189 | 1576 | return realDecoration || forceDecoration; | ||
190 | 1577 | } | ||
191 | 1578 | } | ||
192 | 1402 | /* | 1579 | /* |
193 | 1403 | * DecorWindow::update | 1580 | * DecorWindow::update |
194 | 1404 | * This is the master function for managing decorations on windows | 1581 | * This is the master function for managing decorations on windows |
195 | @@ -1439,8 +1616,6 @@ | |||
196 | 1439 | DecorWindow::update (bool allowDecoration) | 1616 | DecorWindow::update (bool allowDecoration) |
197 | 1440 | { | 1617 | { |
198 | 1441 | Decoration::Ptr old, decoration; | 1618 | Decoration::Ptr old, decoration; |
199 | 1442 | bool decorate = false; | ||
200 | 1443 | bool shadowOnly = true; | ||
201 | 1444 | CompPoint oldShift, movement; | 1619 | CompPoint oldShift, movement; |
202 | 1445 | 1620 | ||
203 | 1446 | if (wd) | 1621 | if (wd) |
204 | @@ -1448,99 +1623,19 @@ | |||
205 | 1448 | else | 1623 | else |
206 | 1449 | old.reset (); | 1624 | old.reset (); |
207 | 1450 | 1625 | ||
250 | 1451 | /* Only want to decorate windows which have a frame or are in the process | 1626 | bool shadowOnly = bareDecorationOnly (); |
251 | 1452 | * of waiting for an animation to be unmapped (in which case we can give | 1627 | bool decorate = shouldDecorateWindow (window, shadowOnly, isSwitcher); |
210 | 1453 | * them a new pixmap type frame since we don't actually need an input | ||
211 | 1454 | * window to go along with that | ||
212 | 1455 | * | ||
213 | 1456 | * FIXME: That's not going to play nice with reparented decorations in core | ||
214 | 1457 | * since the window gets reparented right away before plugins are done | ||
215 | 1458 | * with it */ | ||
216 | 1459 | |||
217 | 1460 | /* Unconditionally decorate switchers */ | ||
218 | 1461 | if (!isSwitcher) | ||
219 | 1462 | { | ||
220 | 1463 | switch (window->type ()) { | ||
221 | 1464 | case CompWindowTypeDialogMask: | ||
222 | 1465 | case CompWindowTypeModalDialogMask: | ||
223 | 1466 | case CompWindowTypeUtilMask: | ||
224 | 1467 | case CompWindowTypeMenuMask: | ||
225 | 1468 | case CompWindowTypeNormalMask: | ||
226 | 1469 | if (window->mwmDecor () & (MwmDecorAll | MwmDecorTitle)) | ||
227 | 1470 | shadowOnly = false; | ||
228 | 1471 | default: | ||
229 | 1472 | break; | ||
230 | 1473 | } | ||
231 | 1474 | |||
232 | 1475 | if (window->overrideRedirect ()) | ||
233 | 1476 | shadowOnly = true; | ||
234 | 1477 | |||
235 | 1478 | if (window->wmType () & (CompWindowTypeDockMask | CompWindowTypeDesktopMask)) | ||
236 | 1479 | shadowOnly = true; | ||
237 | 1480 | |||
238 | 1481 | if (!shadowOnly) | ||
239 | 1482 | { | ||
240 | 1483 | if (!dScreen->optionGetDecorationMatch ().evaluate (window)) | ||
241 | 1484 | shadowOnly = true; | ||
242 | 1485 | } | ||
243 | 1486 | } | ||
244 | 1487 | else | ||
245 | 1488 | shadowOnly = false; | ||
246 | 1489 | |||
247 | 1490 | decorate = ((window->frame () || | ||
248 | 1491 | window->hasUnmapReference ()) && !shadowOnly) || | ||
249 | 1492 | isSwitcher; | ||
252 | 1493 | 1628 | ||
253 | 1494 | if (decorate || frameExtentsRequested) | 1629 | if (decorate || frameExtentsRequested) |
254 | 1495 | { | 1630 | { |
282 | 1496 | /* Attempt to find a matching decoration */ | 1631 | decoration = findRealDecoration (); |
256 | 1497 | try | ||
257 | 1498 | { | ||
258 | 1499 | decoration = decor.findMatchingDecoration (window, true); | ||
259 | 1500 | } | ||
260 | 1501 | catch (...) | ||
261 | 1502 | { | ||
262 | 1503 | /* Find an appropriate default decoration to use */ | ||
263 | 1504 | if (dScreen->dmSupports & WINDOW_DECORATION_TYPE_PIXMAP && | ||
264 | 1505 | dScreen->cmActive && | ||
265 | 1506 | !(dScreen->dmSupports & WINDOW_DECORATION_TYPE_WINDOW && | ||
266 | 1507 | pixmapFailed)) | ||
267 | 1508 | { | ||
268 | 1509 | try | ||
269 | 1510 | { | ||
270 | 1511 | decoration = dScreen->decor[DECOR_ACTIVE].findMatchingDecoration (window, false); | ||
271 | 1512 | } | ||
272 | 1513 | catch (...) | ||
273 | 1514 | { | ||
274 | 1515 | compLogMessage ("decor", CompLogLevelWarn, "No default decoration found, placement will not be correct"); | ||
275 | 1516 | decoration.reset (); | ||
276 | 1517 | } | ||
277 | 1518 | } | ||
278 | 1519 | else if (dScreen->dmSupports & WINDOW_DECORATION_TYPE_WINDOW) | ||
279 | 1520 | decoration = dScreen->windowDefault; | ||
280 | 1521 | } | ||
281 | 1522 | |||
283 | 1523 | /* Do not allow windows which are later undecorated | 1632 | /* Do not allow windows which are later undecorated |
284 | 1524 | * to have a set _NET_FRAME_EXTENTS */ | 1633 | * to have a set _NET_FRAME_EXTENTS */ |
285 | 1525 | if (decorate) | 1634 | if (decorate) |
286 | 1526 | frameExtentsRequested = false; | 1635 | frameExtentsRequested = false; |
287 | 1527 | } | 1636 | } |
288 | 1528 | else | 1637 | else |
304 | 1529 | { | 1638 | decoration = findBareDecoration (); |
290 | 1530 | /* This window isn't "decorated" but it still gets a shadow as long | ||
291 | 1531 | * as it isn't shaped weirdly, since the shadow is just a quad rect */ | ||
292 | 1532 | if (dScreen->optionGetShadowMatch ().evaluate (window)) | ||
293 | 1533 | { | ||
294 | 1534 | if (window->region ().numRects () == 1 && !window->alpha () && dScreen->decor[DECOR_BARE].mList.size ()) | ||
295 | 1535 | decoration = dScreen->decor[DECOR_BARE].mList.front (); | ||
296 | 1536 | |||
297 | 1537 | if (decoration) | ||
298 | 1538 | { | ||
299 | 1539 | if (!checkSize (decoration)) | ||
300 | 1540 | decoration.reset (); | ||
301 | 1541 | } | ||
302 | 1542 | } | ||
303 | 1543 | } | ||
305 | 1544 | 1639 | ||
306 | 1545 | /* Don't allow the windows to be decorated if | 1640 | /* Don't allow the windows to be decorated if |
307 | 1546 | * we're tearing down or if a decorator isn't running | 1641 | * we're tearing down or if a decorator isn't running |
308 | @@ -1555,25 +1650,14 @@ | |||
309 | 1555 | if (decoration == old) | 1650 | if (decoration == old) |
310 | 1556 | return false; | 1651 | return false; |
311 | 1557 | 1652 | ||
312 | 1558 | /* We need to damage the current output extents | ||
313 | 1559 | * and recompute the shadow region if a compositor | ||
314 | 1560 | * is running | ||
315 | 1561 | */ | ||
316 | 1562 | if (dScreen->cmActive) | ||
317 | 1563 | { | ||
318 | 1564 | cWindow->damageOutputExtents (); | ||
319 | 1565 | updateGroupShadows (); | ||
320 | 1566 | } | ||
321 | 1567 | |||
322 | 1568 | /* Determine how much we moved the window for the old | 1653 | /* Determine how much we moved the window for the old |
323 | 1569 | * decoration and save that, also destroy the old | 1654 | * decoration and save that, also destroy the old |
324 | 1570 | * WindowDecoration */ | 1655 | * WindowDecoration */ |
325 | 1571 | if (old) | 1656 | if (old) |
326 | 1572 | { | 1657 | { |
328 | 1573 | oldShift = compiz::window::extents::shift (window->border (), window->sizeHints ().win_gravity); | 1658 | oldShift = cwe::shift (window->border (), window->sizeHints ().win_gravity); |
329 | 1574 | 1659 | ||
330 | 1575 | WindowDecoration::destroy (wd); | 1660 | WindowDecoration::destroy (wd); |
331 | 1576 | |||
332 | 1577 | wd = NULL; | 1661 | wd = NULL; |
333 | 1578 | } | 1662 | } |
334 | 1579 | 1663 | ||
335 | @@ -1595,8 +1679,10 @@ | |||
336 | 1595 | window->setWindowFrameExtents (&decoration->border, | 1679 | window->setWindowFrameExtents (&decoration->border, |
337 | 1596 | &decoration->input); | 1680 | &decoration->input); |
338 | 1597 | 1681 | ||
341 | 1598 | /* We actually need to decorate this window */ | 1682 | /* This window actually needs its decoration contents updated |
342 | 1599 | if (decorate) | 1683 | * as it was actually visible */ |
343 | 1684 | if (decorate || | ||
344 | 1685 | shadowOnly) | ||
345 | 1600 | { | 1686 | { |
346 | 1601 | wd = WindowDecoration::create (decoration); | 1687 | wd = WindowDecoration::create (decoration); |
347 | 1602 | if (!wd) | 1688 | if (!wd) |
348 | @@ -1608,20 +1694,21 @@ | |||
349 | 1608 | return false; | 1694 | return false; |
350 | 1609 | } | 1695 | } |
351 | 1610 | 1696 | ||
353 | 1611 | movement = compiz::window::extents::shift (window->border (), window->sizeHints ().win_gravity); | 1697 | movement = cwe::shift (window->border (), window->sizeHints ().win_gravity); |
354 | 1612 | movement -= oldShift; | 1698 | movement -= oldShift; |
355 | 1613 | 1699 | ||
356 | 1614 | /* Update the input and output frame */ | ||
357 | 1615 | updateFrame (); | ||
358 | 1616 | window->updateWindowOutputExtents (); | 1700 | window->updateWindowOutputExtents (); |
359 | 1617 | 1701 | ||
360 | 1618 | updateReg = true; | 1702 | updateReg = true; |
361 | 1619 | updateMatrix = true; | 1703 | updateMatrix = true; |
362 | 1620 | mOutputRegion = CompRegion (window->outputRect ()); | 1704 | mOutputRegion = CompRegion (window->outputRect ()); |
363 | 1621 | updateGroupShadows (); | ||
364 | 1622 | if (dScreen->cmActive) | 1705 | if (dScreen->cmActive) |
365 | 1623 | cWindow->damageOutputExtents (); | 1706 | cWindow->damageOutputExtents (); |
366 | 1624 | updateDecorationScale (); | 1707 | updateDecorationScale (); |
367 | 1708 | |||
368 | 1709 | /* Update the input and output frame */ | ||
369 | 1710 | if (decorate) | ||
370 | 1711 | updateFrame (); | ||
371 | 1625 | } | 1712 | } |
372 | 1626 | } | 1713 | } |
373 | 1627 | else | 1714 | else |
374 | @@ -1641,55 +1728,19 @@ | |||
375 | 1641 | movement -= oldShift; | 1728 | movement -= oldShift; |
376 | 1642 | } | 1729 | } |
377 | 1643 | 1730 | ||
381 | 1644 | /* Need to actually move the window */ | 1731 | /* We need to damage the current output extents |
382 | 1645 | if (window->placed () && !window->overrideRedirect () && | 1732 | * and recompute the shadow region if a compositor |
383 | 1646 | (movement.x () || movement.y ())) | 1733 | * is running |
384 | 1734 | */ | ||
385 | 1735 | if (dScreen->cmActive) | ||
386 | 1647 | { | 1736 | { |
430 | 1648 | XWindowChanges xwc; | 1737 | cWindow->damageOutputExtents (); |
431 | 1649 | unsigned int mask = CWX | CWY; | 1738 | updateGroupShadows (); |
389 | 1650 | |||
390 | 1651 | memset (&xwc, 0, sizeof (XWindowChanges)); | ||
391 | 1652 | |||
392 | 1653 | /* Grab the geometry last sent to server at configureXWindow | ||
393 | 1654 | * time and not here since serverGeometry may be updated by | ||
394 | 1655 | * the time that we do call configureXWindow */ | ||
395 | 1656 | xwc.x = movement.x (); | ||
396 | 1657 | xwc.y = movement.y (); | ||
397 | 1658 | |||
398 | 1659 | /* Except if it's fullscreen, maximized or such */ | ||
399 | 1660 | if (window->state () & CompWindowStateFullscreenMask) | ||
400 | 1661 | mask &= ~(CWX | CWY); | ||
401 | 1662 | |||
402 | 1663 | if (window->state () & CompWindowStateMaximizedHorzMask) | ||
403 | 1664 | mask &= ~CWX; | ||
404 | 1665 | |||
405 | 1666 | if (window->state () & CompWindowStateMaximizedVertMask) | ||
406 | 1667 | mask &= ~CWY; | ||
407 | 1668 | |||
408 | 1669 | if (window->saveMask () & CWX) | ||
409 | 1670 | window->saveWc ().x += movement.x (); | ||
410 | 1671 | |||
411 | 1672 | if (window->saveMask () & CWY) | ||
412 | 1673 | window->saveWc ().y += movement.y (); | ||
413 | 1674 | |||
414 | 1675 | if (mask) | ||
415 | 1676 | { | ||
416 | 1677 | /* allowDecoration is only false in the case of | ||
417 | 1678 | * the destructor calling the update function so since it | ||
418 | 1679 | * is not safe to put the function in a timer (since | ||
419 | 1680 | * it will get unref'd on the vtable destruction) we | ||
420 | 1681 | * need to do it immediately | ||
421 | 1682 | * | ||
422 | 1683 | * FIXME: CompTimer should really be PIMPL and allow | ||
423 | 1684 | * refcounting in case we need to keep it alive | ||
424 | 1685 | */ | ||
425 | 1686 | if (!allowDecoration) | ||
426 | 1687 | decorOffsetMove (window, xwc, mask); | ||
427 | 1688 | else | ||
428 | 1689 | moveUpdate.start (boost::bind (decorOffsetMove, window, xwc, mask), 0); | ||
429 | 1690 | } | ||
432 | 1691 | } | 1739 | } |
433 | 1692 | 1740 | ||
434 | 1741 | moveDecoratedWindowBy (movement, | ||
435 | 1742 | !allowDecoration); | ||
436 | 1743 | |||
437 | 1693 | return true; | 1744 | return true; |
438 | 1694 | } | 1745 | } |
439 | 1695 | 1746 | ||
440 | 1696 | 1747 | ||
441 | === modified file 'plugins/decor/src/decor.h' | |||
442 | --- plugins/decor/src/decor.h 2013-02-20 03:07:58 +0000 | |||
443 | +++ plugins/decor/src/decor.h 2013-03-22 16:49:24 +0000 | |||
444 | @@ -152,6 +152,13 @@ | |||
445 | 152 | 152 | ||
446 | 153 | unsigned int updateState; | 153 | unsigned int updateState; |
447 | 154 | X11DecorPixmapReceiver mPixmapReceiver; | 154 | X11DecorPixmapReceiver mPixmapReceiver; |
448 | 155 | |||
449 | 156 | private: | ||
450 | 157 | |||
451 | 158 | bool bareDecorationOnly (); | ||
452 | 159 | Decoration::Ptr findRealDecoration (); | ||
453 | 160 | Decoration::Ptr findBareDecoration (); | ||
454 | 161 | void moveDecoratedWindowBy (const CompPoint &movement); | ||
455 | 155 | }; | 162 | }; |
456 | 156 | 163 | ||
457 | 157 | class DecorationList : | 164 | class DecorationList : |
458 | @@ -372,6 +379,14 @@ | |||
459 | 372 | CompRegion mInputRegion; | 379 | CompRegion mInputRegion; |
460 | 373 | 380 | ||
461 | 374 | X11DecorPixmapRequestor mRequestor; | 381 | X11DecorPixmapRequestor mRequestor; |
462 | 382 | |||
463 | 383 | private: | ||
464 | 384 | |||
465 | 385 | bool bareDecorationOnly (); | ||
466 | 386 | Decoration::Ptr findRealDecoration (); | ||
467 | 387 | Decoration::Ptr findBareDecoration (); | ||
468 | 388 | void moveDecoratedWindowBy (const CompPoint &movement, | ||
469 | 389 | bool instant); | ||
470 | 375 | }; | 390 | }; |
471 | 376 | 391 | ||
472 | 377 | class DecorPluginVTable : | 392 | class DecorPluginVTable : |
It's ok. Tested, the fix works and doesn't seem to have any regressions. The refactoring is not too big, so it should be fine.