From 188a47f0dbe9ac03b54733f577090a70fc25d369 Mon Sep 17 00:00:00 2001 From: Lucas Murray Date: Sat, 7 Feb 2009 05:56:28 +0000 Subject: [PATCH] Backport: Fixed cube from crashing due to mouse polling if it was activated and deactivated too quickly. svn path=/branches/KDE/4.2/kdebase/workspace/; revision=922459 --- effects/cube.cpp | 13 +++++++++++-- effects/cube.h | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/effects/cube.cpp b/effects/cube.cpp index 894bb14fa5..93c1810601 100644 --- a/effects/cube.cpp +++ b/effects/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 ) @@ -1537,7 +1538,11 @@ void CubeEffect::setActive( bool active ) { if( active ) { - effects->startMousePolling(); + if( !mousePolling ) + { + effects->startMousePolling(); + mousePolling = true; + } activated = true; activeScreen = effects->activeScreen(); if( !slide ) @@ -1575,7 +1580,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.h b/effects/cube.h index eb4b72a32d..cbf6b9266c 100644 --- a/effects/cube.h +++ b/effects/cube.h @@ -75,6 +75,7 @@ class CubeEffect void rotateToDesktop( int desktop ); void setActive( bool active ); bool activated; + bool mousePolling; bool cube_painting; bool keyboard_grab; bool schedule_close;