diff options
authorMartin Gräßlin <>2012-05-11 17:55:56 (GMT)
committerMartin Gräßlin <>2012-05-22 16:35:30 (GMT)
commit6a950aa510e33ce77b15608f19f6032176acd1f0 (patch)
parentbe2a8bf3ecf036bc95e1210359dafaa3ce30f733 (diff)
Ensure ScreenTransformation matrix is reset after rendering cube
Cube effect modifies the ScreenTransformation matrix. While each window resets the matrix on a global level it's not reset. That means if the last rendered window had the screen rotated the ScreenTransformation keeps the rotation even after the cube ended. This causes a rotated window in e.g. TaskbarThumbnails. Cherry-picked from 9417a76132b5af438d25870c479e60518d7b0270 BUG: 299869 FIXED-IN: 4.8.4 REVIEW: 104918
1 files changed, 7 insertions, 0 deletions
diff --git a/kwin/effects/cube/cube.cpp b/kwin/effects/cube/cube.cpp
index 9b957c2..859c087 100644
--- a/kwin/effects/cube/cube.cpp
+++ b/kwin/effects/cube/cube.cpp
@@ -570,6 +570,13 @@ void CubeEffect::paintScreen(int mask, QRegion region, ScreenPaintData& data)
desktopNameFrame->render(region, opacity);
+ // restore the ScreenTransformation after all desktops are painted
+ // if not done GenericShader keeps the rotation data and transforms windows incorrectly in other rendering calls
+ if (ShaderManager::instance()->isValid()) {
+ GLShader *shader = ShaderManager::instance()->pushShader(KWin::ShaderManager::GenericShader);
+ shader->setUniform(GLShader::ScreenTransformation, QMatrix4x4());
+ ShaderManager::instance()->popShader();
+ }
} else {
effects->paintScreen(mask, region, data);