From 1db192a11da7505f83f26e7ca0c354ccff48a17e Mon Sep 17 00:00:00 2001 From: Lucas Murray Date: Sat, 7 Feb 2009 05:52:25 +0000 Subject: [PATCH] Fixed cube from crashing due to mouse polling if it was activated and deactivated too quickly. svn path=/trunk/KDE/kdebase/workspace/; revision=922457 --- effects/cube/cube.cpp | 13 +++++++++++-- effects/cube/cube.h | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) 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;