diff --git a/effects/magnifier/magnifier.cpp b/effects/magnifier/magnifier.cpp index 8bd574643d..7058547bce 100644 --- a/effects/magnifier/magnifier.cpp +++ b/effects/magnifier/magnifier.cpp @@ -96,33 +96,37 @@ void MagnifierEffect::paintScreen( int mask, QRegion region, ScreenPaintData& da data2.yTranslate = - int( cursor.y() * ( zoom - 1 )); effects->paintScreen( mask, region, data2 ); PaintClipper::pop( area ); -// ## TODO this should be inside KWIN_HAVE_OPENGL_COMPOSITING - glPushAttrib( GL_CURRENT_BIT ); - glColor4f( 0, 0, 0, 1 ); // black - for( PaintClipper::Iterator iterator; - !iterator.isDone(); - iterator.next()) +#ifdef KWIN_HAVE_OPENGL_COMPOSITING + if( effects->compositingType() == KWin::OpenGLCompositing ) { - glBegin( GL_QUADS ); - glVertex2i( area.left() - FRAME_WIDTH, area.top() - FRAME_WIDTH ); // top frame - glVertex2i( area.right() + FRAME_WIDTH, area.top() - FRAME_WIDTH ); - glVertex2i( area.right() + FRAME_WIDTH, area.top() - 1 ); - glVertex2i( area.left() - FRAME_WIDTH, area.top() - 1 ); - glVertex2i( area.left() - FRAME_WIDTH, area.top() - FRAME_WIDTH ); // left frame - glVertex2i( area.left() - 1, area.top() - FRAME_WIDTH ); - glVertex2i( area.left() - 1, area.bottom() + FRAME_WIDTH ); - glVertex2i( area.left() - FRAME_WIDTH, area.bottom() + FRAME_WIDTH ); - glVertex2i( area.right() + 1, area.top() - FRAME_WIDTH ); // right frame - glVertex2i( area.right() + FRAME_WIDTH, area.top() - FRAME_WIDTH ); - glVertex2i( area.right() + FRAME_WIDTH, area.bottom() + FRAME_WIDTH ); - glVertex2i( area.right() + 1, area.bottom() + FRAME_WIDTH ); - glVertex2i( area.left() - FRAME_WIDTH, area.bottom() + 1 ); // bottom frame - glVertex2i( area.right() + FRAME_WIDTH, area.bottom() + 1 ); - glVertex2i( area.right() + FRAME_WIDTH, area.bottom() + FRAME_WIDTH ); - glVertex2i( area.left() - FRAME_WIDTH, area.bottom() + FRAME_WIDTH ); - glEnd(); + glPushAttrib( GL_CURRENT_BIT ); + glColor4f( 0, 0, 0, 1 ); // black + for( PaintClipper::Iterator iterator; + !iterator.isDone(); + iterator.next()) + { + glBegin( GL_QUADS ); + glVertex2i( area.left() - FRAME_WIDTH, area.top() - FRAME_WIDTH ); // top frame + glVertex2i( area.right() + FRAME_WIDTH, area.top() - FRAME_WIDTH ); + glVertex2i( area.right() + FRAME_WIDTH, area.top() - 1 ); + glVertex2i( area.left() - FRAME_WIDTH, area.top() - 1 ); + glVertex2i( area.left() - FRAME_WIDTH, area.top() - FRAME_WIDTH ); // left frame + glVertex2i( area.left() - 1, area.top() - FRAME_WIDTH ); + glVertex2i( area.left() - 1, area.bottom() + FRAME_WIDTH ); + glVertex2i( area.left() - FRAME_WIDTH, area.bottom() + FRAME_WIDTH ); + glVertex2i( area.right() + 1, area.top() - FRAME_WIDTH ); // right frame + glVertex2i( area.right() + FRAME_WIDTH, area.top() - FRAME_WIDTH ); + glVertex2i( area.right() + FRAME_WIDTH, area.bottom() + FRAME_WIDTH ); + glVertex2i( area.right() + 1, area.bottom() + FRAME_WIDTH ); + glVertex2i( area.left() - FRAME_WIDTH, area.bottom() + 1 ); // bottom frame + glVertex2i( area.right() + FRAME_WIDTH, area.bottom() + 1 ); + glVertex2i( area.right() + FRAME_WIDTH, area.bottom() + FRAME_WIDTH ); + glVertex2i( area.left() - FRAME_WIDTH, area.bottom() + FRAME_WIDTH ); + glEnd(); + } + glPopAttrib(); } - glPopAttrib(); +#endif } }