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
This commit is contained in:
Lucas Murray 2008-11-29 09:32:59 +00:00
parent a3d487cf92
commit ebb0fe0979

View file

@ -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 );
}