Merge lp:~vanvugt/compiz/fix-1047168 into lp:compiz/0.9.8

Proposed by Daniel van Vugt
Status: Merged
Approved by: Sam Spilsbury
Approved revision: 3384
Merged at revision: 3383
Proposed branch: lp:~vanvugt/compiz/fix-1047168
Merge into: lp:compiz/0.9.8
Diff against target: 60 lines (+34/-1)
2 files modified
plugins/opengl/src/paint.cpp (+14/-1)
tests/manual/Unredirect.txt (+20/-0)
To merge this branch: bzr merge lp:~vanvugt/compiz/fix-1047168
Reviewer Review Type Date Requested Status
Sam Spilsbury Approve
Review via email: mp+125626@code.launchpad.net

Commit message

Ensure unredirected windows get redirected if windows are being transformed,
like in scale mode.
(LP: #1047168)

Description of the change

Ensure unredirected windows get redirected if windows are being transformed,
like in scale mode.
(LP: #1047168)

To post a comment you must log in.
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

27 + if (!region.isEmpty () ||
28 + (mask & PAINT_SCREEN_FULL_MASK) ||
29 + (mask & PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK))

This indicates to me that the fullscreen window unredirection code is living in the wrong place. It is probably a state machine that should be updated whenever window positions and sizes are changed. It probably also makes sense to force redirection where a window is transformed (and we can detect this in the occlusion pass, which should also be moved up above paintOutputs). What I'm proposing though is a fairly big change and we should leave it until next cycle. Until now this will do.

review: Approve
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I have tried moving that code before and found it to be exceptionally fragile for some reason. But I agree reredirect/unredirect should theoretically be done elsewhere.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'plugins/opengl/src/paint.cpp'
--- plugins/opengl/src/paint.cpp 2012-09-18 08:05:55 +0000
+++ plugins/opengl/src/paint.cpp 2012-09-21 06:08:19 +0000
@@ -352,6 +352,7 @@
352 */352 */
353 if (unredirectFS &&353 if (unredirectFS &&
354 !(mask & PAINT_SCREEN_TRANSFORMED_MASK) &&354 !(mask & PAINT_SCREEN_TRANSFORMED_MASK) &&
355 !(mask & PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK) &&
355 fs.isCoveredBy (w->region (), flags))356 fs.isCoveredBy (w->region (), flags))
356 {357 {
357 unredirected.insert (w);358 unredirected.insert (w);
@@ -618,7 +619,19 @@
618619
619 sTransform.toScreenSpace (output, -DEFAULT_Z_CAMERA);620 sTransform.toScreenSpace (output, -DEFAULT_Z_CAMERA);
620621
621 if (!region.isEmpty ())622 /*
623 * Sometimes region might be empty but we still need to force the
624 * repaint. This can happen when a fullscreen window is unredirected,
625 * and damageScreen is called. CompositeScreen::handlePaintTimeout
626 * then subtracts the whole screen of damage because it's an overlay
627 * and we're left with an empty damage region.
628 * Even when this happens we may want to force the repaint if
629 * windows are getting transformed (and so the unredirected window
630 * needs to be redirected again).
631 */
632 if (!region.isEmpty () ||
633 (mask & PAINT_SCREEN_FULL_MASK) ||
634 (mask & PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK))
622 priv->paintOutputRegion (sTransform, region, output, mask);635 priv->paintOutputRegion (sTransform, region, output, mask);
623636
624 return true;637 return true;
625638
=== modified file 'tests/manual/Unredirect.txt'
--- tests/manual/Unredirect.txt 2012-09-06 06:49:21 +0000
+++ tests/manual/Unredirect.txt 2012-09-21 06:08:19 +0000
@@ -75,3 +75,23 @@
7575
76Expected Result:76Expected Result:
77 The gnome-terminal window should be visible on top.77 The gnome-terminal window should be visible on top.
78
79
80Unredirect cancelation by transformed windows (LP: #1047168)
81-------------------------------------------------------------
82Setup:
83#. Install Chromium or Chrome browser.
84#. Run ccsm and ensure the Scale plugin is loaded and "Initiate Window Picker"
85 is bound to Shift+Alt+Up.
86
87Actions:
88#. Open a Chrome/Chromium window.
89#. Open a gnome-terminal window (Ctrl+Alt+T)
90#. Move the gnome-terminal to the centre of the screen, above the Chrome
91 window.
92#. Click on the Chrome window and make it fullscreen (F11).
93#. Hold Shift+Alt and tap Up to engage scale mode. Keep holding Shift+Alt
94 for a few seconds.
95
96Expected Result:
97 Windows get scaled and you can see both the Chrome and Terminal windows.

Subscribers

People subscribed via source and target branches