From e4d970ef5fce50c83407986f7ec3c1cb217b6f60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=B6glund?= Date: Wed, 12 Sep 2012 23:00:15 +0200 Subject: [PATCH] kwin: Don't hold an X server grab while painting the screen According to Pierre-Loup Griffais (Plagman on IRC) this is causing choppy VDPAU video playback when compositing is enabled. Removing these calls doesn't seem to cause any regressions, and the commit that added them doesn't give a reason. So let's just get rid of them for now. (cherry picked from commit 20e6349843d9bb838673a301330d7dc5d08401a5) --- scene_opengl_egl.cpp | 3 +-- scene_opengl_glx.cpp | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/scene_opengl_egl.cpp b/scene_opengl_egl.cpp index 33e8960413..06d196a480 100644 --- a/scene_opengl_egl.cpp +++ b/scene_opengl_egl.cpp @@ -200,14 +200,13 @@ int SceneOpenGL::paint(QRegion damage, ToplevelList toplevels) stacking_order.append(windows[ c ]); } - grabXServer(); XSync(display(), false); int mask = 0; paintScreen(&mask, &damage); // call generic implementation m_lastMask = mask; m_lastDamage = damage; glFlush(); - ungrabXServer(); + if (m_overlayWindow->window()) // show the window only after the first pass, since m_overlayWindow->show(); // that pass may take long diff --git a/scene_opengl_glx.cpp b/scene_opengl_glx.cpp index b016bba932..1fe2f180ba 100644 --- a/scene_opengl_glx.cpp +++ b/scene_opengl_glx.cpp @@ -468,7 +468,6 @@ int SceneOpenGL::paint(QRegion damage, ToplevelList toplevels) stacking_order.append(windows[ c ]); } - grabXServer(); glXWaitX(); if (m_resetModelViewProjectionMatrix) { // reset model view projection matrix if required @@ -487,7 +486,6 @@ int SceneOpenGL::paint(QRegion damage, ToplevelList toplevels) glFlush(); - ungrabXServer(); if (m_overlayWindow->window()) // show the window only after the first pass, m_overlayWindow->show(); // since that pass may take long