From 82150abeb3ca57dbff7056d3a6459d9f5f84e1e4 Mon Sep 17 00:00:00 2001 From: Jacopo De Simoi Date: Tue, 15 Mar 2011 22:17:26 +0100 Subject: [PATCH] Fix jerky animations for the XRender backend The code controlling timing for the animations assumes that all painting is finished when the Scene has finished painting. Since the X protocol is asyncronous we need to call XSync (and not XFlush) to make sure all painting has finished. Tested for more than 2 weeks without issues. NB: This is the same commit as d0cf7ff6da4c6f8bcc684dd6378e2af09d36bb06 due to style changes in kwin code I could not cherry-pick it cleanly --- scene_xrender.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scene_xrender.cpp b/scene_xrender.cpp index 4dacc7fdf0..0a24e9b590 100644 --- a/scene_xrender.cpp +++ b/scene_xrender.cpp @@ -291,11 +291,11 @@ void SceneXrender::flushBuffer(int mask, QRegion damage) XFixesSetPictureClipRegion(display(), buffer, 0, 0, None); XRenderComposite(display(), PictOpSrc, buffer, None, front, 0, 0, 0, 0, 0, 0, displayWidth(), displayHeight()); XFixesSetPictureClipRegion(display(), front, 0, 0, None); - XFlush(display()); + XSync(display(), false); } else { // copy composed buffer to the root window XRenderComposite(display(), PictOpSrc, buffer, None, front, 0, 0, 0, 0, 0, 0, displayWidth(), displayHeight()); - XFlush(display()); + XSync(display(), false); } }