From ebb0fe09795c079f817be49a177f8a10b01e4329 Mon Sep 17 00:00:00 2001 From: Lucas Murray Date: Sat, 29 Nov 2008 09:32:59 +0000 Subject: [PATCH] Use a hack to fix the reflection base position in cover switch, added just in case Martin doesn't get around to fixing it before 4.2 release. CCMAIL: ubuntu@martin-graesslin.com svn path=/trunk/KDE/kdebase/workspace/; revision=890407 --- effects/coverswitch.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/effects/coverswitch.cpp b/effects/coverswitch.cpp index 359ebafaae..6b7ad76d95 100644 --- a/effects/coverswitch.cpp +++ b/effects/coverswitch.cpp @@ -256,15 +256,28 @@ void CoverSwitchEffect::paintScreen( int mask, QRegion region, ScreenPaintData& else if( stop ) alpha = 1.0 - timeLine.value(); glColor4f( 0.0, 0.0, 0.0, alpha ); + + // HACK: Use a scissor to only display the reflection area on the correct screen. + // All the above code should be converted to use a scissor from the beginning or + // get the correct coords and use those instead. + QRect screenRect = effects->clientArea( ScreenArea, activeScreen, effects->currentDesktop() ); + glScissor( screenRect.x(), screenRect.y(), screenRect.width(), screenRect.height() ); + glEnable( GL_SCISSOR_TEST ); + glBegin( GL_POLYGON ); glVertex3f( vertices[0], vertices[1], vertices[2] ); glVertex3f( vertices[3], vertices[4], vertices[5] ); // rearground alpha = -1.0; glColor4f( 0.0, 0.0, 0.0, alpha ); - glVertex3f( vertices[6], vertices[7], vertices[8] ); - glVertex3f( vertices[9], vertices[10], vertices[11] ); + //glVertex3f( vertices[6], vertices[7], vertices[8] ); + //glVertex3f( vertices[9], vertices[10], vertices[11] ); + glVertex3f( vertices[6]*2, vertices[7], vertices[8] ); // } Scissor HACK + glVertex3f( vertices[9]*2, vertices[10], vertices[11] ); // glEnd(); + + glDisable( GL_SCISSOR_TEST ); // Scissor HACK + glPopMatrix(); glDisable( GL_BLEND ); }