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
1=== modified file 'plugins/opengl/src/paint.cpp'
2--- plugins/opengl/src/paint.cpp 2012-09-18 08:05:55 +0000
3+++ plugins/opengl/src/paint.cpp 2012-09-21 06:08:19 +0000
4@@ -352,6 +352,7 @@
5 */
6 if (unredirectFS &&
7 !(mask & PAINT_SCREEN_TRANSFORMED_MASK) &&
8+ !(mask & PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK) &&
9 fs.isCoveredBy (w->region (), flags))
10 {
11 unredirected.insert (w);
12@@ -618,7 +619,19 @@
13
14 sTransform.toScreenSpace (output, -DEFAULT_Z_CAMERA);
15
16- if (!region.isEmpty ())
17+ /*
18+ * Sometimes region might be empty but we still need to force the
19+ * repaint. This can happen when a fullscreen window is unredirected,
20+ * and damageScreen is called. CompositeScreen::handlePaintTimeout
21+ * then subtracts the whole screen of damage because it's an overlay
22+ * and we're left with an empty damage region.
23+ * Even when this happens we may want to force the repaint if
24+ * windows are getting transformed (and so the unredirected window
25+ * needs to be redirected again).
26+ */
27+ if (!region.isEmpty () ||
28+ (mask & PAINT_SCREEN_FULL_MASK) ||
29+ (mask & PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK))
30 priv->paintOutputRegion (sTransform, region, output, mask);
31
32 return true;
33
34=== modified file 'tests/manual/Unredirect.txt'
35--- tests/manual/Unredirect.txt 2012-09-06 06:49:21 +0000
36+++ tests/manual/Unredirect.txt 2012-09-21 06:08:19 +0000
37@@ -75,3 +75,23 @@
38
39 Expected Result:
40 The gnome-terminal window should be visible on top.
41+
42+
43+Unredirect cancelation by transformed windows (LP: #1047168)
44+-------------------------------------------------------------
45+Setup:
46+#. Install Chromium or Chrome browser.
47+#. Run ccsm and ensure the Scale plugin is loaded and "Initiate Window Picker"
48+ is bound to Shift+Alt+Up.
49+
50+Actions:
51+#. Open a Chrome/Chromium window.
52+#. Open a gnome-terminal window (Ctrl+Alt+T)
53+#. Move the gnome-terminal to the centre of the screen, above the Chrome
54+ window.
55+#. Click on the Chrome window and make it fullscreen (F11).
56+#. Hold Shift+Alt and tap Up to engage scale mode. Keep holding Shift+Alt
57+ for a few seconds.
58+
59+Expected Result:
60+ Windows get scaled and you can see both the Chrome and Terminal windows.

Subscribers

People subscribed via source and target branches