diff --git a/effects/cube/cube.cpp b/effects/cube/cube.cpp index e173a50dd6..c1ceb5218c 100644 --- a/effects/cube/cube.cpp +++ b/effects/cube/cube.cpp @@ -46,6 +46,7 @@ KWIN_EFFECT_SUPPORTED( cube, CubeEffect::supported() ) CubeEffect::CubeEffect() : activated( false ) + , mousePolling( false ) , cube_painting( false ) , keyboard_grab( false ) , schedule_close( false ) @@ -1615,7 +1616,11 @@ void CubeEffect::setActive( bool active ) { if( active ) { - effects->startMousePolling(); + if( !mousePolling ) + { + effects->startMousePolling(); + mousePolling = true; + } activated = true; activeScreen = effects->activeScreen(); keyboard_grab = effects->grabKeyboard( this ); @@ -1662,7 +1667,11 @@ void CubeEffect::setActive( bool active ) } else { - effects->stopMousePolling(); + if( mousePolling ) + { + effects->stopMousePolling(); + mousePolling = false; + } schedule_close = true; // we have to add a repaint, to start the deactivating effects->addRepaintFull(); diff --git a/effects/cube/cube.h b/effects/cube/cube.h index bf98cd73f4..1f4a62c2ca 100644 --- a/effects/cube/cube.h +++ b/effects/cube/cube.h @@ -77,6 +77,7 @@ class CubeEffect void rotateToDesktop( int desktop ); void setActive( bool active ); bool activated; + bool mousePolling; bool cube_painting; bool keyboard_grab; bool schedule_close;