Merge lp:~vanvugt/compiz/fix-reredirect-flicker into lp:compiz/0.9.8

Proposed by Daniel van Vugt
Status: Merged
Approved by: Sam Spilsbury
Approved revision: 3381
Merged at revision: 3381
Proposed branch: lp:~vanvugt/compiz/fix-reredirect-flicker
Merge into: lp:compiz/0.9.8
Diff against target: 94 lines (+26/-0)
4 files modified
plugins/composite/include/composite/composite.h (+1/-0)
plugins/composite/src/privates.h (+1/-0)
plugins/composite/src/screen.cpp (+13/-0)
plugins/opengl/src/screen.cpp (+11/-0)
To merge this branch: bzr merge lp:~vanvugt/compiz/fix-reredirect-flicker
Reviewer Review Type Date Requested Status
Sam Spilsbury Approve
jenkins (community) continuous-integration Approve
Review via email: mp+125443@code.launchpad.net

Commit message

Changes to the composite output window's shape seem to take a full frame to be
realized by GLX/the server. This results in a single frame of flicker when an
unredirected window gets redirected, but the shape change is still not
realized.

To work around this flicker, just skip the one frame where it's going to
occur so you never see it.
(LP: #1046664)

Description of the change

See commit message.

Yes, I did try XSync to force shape changes to be realized before we render but it still doesn't work. Only skipping a frame seems to work.

To post a comment you must log in.
Revision history for this message
jenkins (martin-mrazik+qa) wrote :
review: Approve (continuous-integration)
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

This is fine, although ideally we should probably move the unredirection code into paintOutputs and not paintOutputRegion - then we can update the output window and not worry about frame skips. That's nontrivial though, so lets leave it for later.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'plugins/composite/include/composite/composite.h'
--- plugins/composite/include/composite/composite.h 2012-07-02 07:07:32 +0000
+++ plugins/composite/include/composite/composite.h 2012-09-20 09:46:21 +0000
@@ -205,6 +205,7 @@
205 void showOutputWindow ();205 void showOutputWindow ();
206 void hideOutputWindow ();206 void hideOutputWindow ();
207 void updateOutputWindow ();207 void updateOutputWindow ();
208 bool outputWindowChanged () const;
208209
209 Window overlay ();210 Window overlay ();
210 Window output ();211 Window output ();
211212
=== modified file 'plugins/composite/src/privates.h'
--- plugins/composite/src/privates.h 2012-07-02 07:07:32 +0000
+++ plugins/composite/src/privates.h 2012-09-20 09:46:21 +0000
@@ -93,6 +93,7 @@
93 CompPoint windowPaintOffset;93 CompPoint windowPaintOffset;
9494
95 int overlayWindowCount;95 int overlayWindowCount;
96 bool outputShapeChanged;
9697
97 struct timeval lastRedraw;98 struct timeval lastRedraw;
98 int redrawTime;99 int redrawTime;
99100
=== modified file 'plugins/composite/src/screen.cpp'
--- plugins/composite/src/screen.cpp 2012-07-30 12:55:44 +0000
+++ plugins/composite/src/screen.cpp 2012-09-20 09:46:21 +0000
@@ -281,6 +281,7 @@
281 exposeRects (),281 exposeRects (),
282 windowPaintOffset (0, 0),282 windowPaintOffset (0, 0),
283 overlayWindowCount (0),283 overlayWindowCount (0),
284 outputShapeChanged (false),
284 redrawTime (1000 / FALLBACK_REFRESH_RATE),285 redrawTime (1000 / FALLBACK_REFRESH_RATE),
285 optimalRedrawTime (1000 / FALLBACK_REFRESH_RATE),286 optimalRedrawTime (1000 / FALLBACK_REFRESH_RATE),
286 scheduled (false),287 scheduled (false),
@@ -543,6 +544,8 @@
543 XFixesDestroyRegion (dpy, region);544 XFixesDestroyRegion (dpy, region);
544545
545 damageScreen ();546 damageScreen ();
547
548 priv->outputShapeChanged = true;
546 }549 }
547}550}
548551
@@ -591,10 +594,18 @@
591 0, 0, region);594 0, 0, region);
592595
593 XFixesDestroyRegion (dpy, region);596 XFixesDestroyRegion (dpy, region);
597
598 priv->outputShapeChanged = true;
594 }599 }
595600
596}601}
597602
603bool
604CompositeScreen::outputWindowChanged () const
605{
606 return priv->outputShapeChanged;
607}
608
598void609void
599PrivateCompositeScreen::makeOutputWindow ()610PrivateCompositeScreen::makeOutputWindow ()
600{611{
@@ -833,6 +844,8 @@
833844
834 donePaint ();845 donePaint ();
835846
847 priv->outputShapeChanged = false;
848
836 foreach (CompWindow *w, screen->windows ())849 foreach (CompWindow *w, screen->windows ())
837 {850 {
838 if (w->destroyed ())851 if (w->destroyed ())
839852
=== modified file 'plugins/opengl/src/screen.cpp'
--- plugins/opengl/src/screen.cpp 2012-09-13 08:35:17 +0000
+++ plugins/opengl/src/screen.cpp 2012-09-20 09:46:21 +0000
@@ -2035,6 +2035,17 @@
2035 gScreen->glPaintCompositedOutput (screen->region (), scratchFbo, mask);2035 gScreen->glPaintCompositedOutput (screen->region (), scratchFbo, mask);
2036 }2036 }
20372037
2038 if (cScreen->outputWindowChanged ())
2039 {
2040 /*
2041 * Changes to the composite output window seem to take a whole frame
2042 * to take effect. So to avoid a visible flicker, we skip this frame
2043 * and do a full redraw next time.
2044 */
2045 cScreen->damageScreen ();
2046 return;
2047 }
2048
2038 bool alwaysSwap = optionGetAlwaysSwapBuffers ();2049 bool alwaysSwap = optionGetAlwaysSwapBuffers ();
2039 bool fullscreen = useFbo ||2050 bool fullscreen = useFbo ||
2040 alwaysSwap ||2051 alwaysSwap ||

Subscribers

People subscribed via source and target branches