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
This commit is contained in:
Lucas Murray 2009-02-07 05:56:28 +00:00
parent 9bb76644b7
commit 188a47f0db
2 changed files with 12 additions and 2 deletions

View file

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

View file

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