Abort effect if the current tab box window is deleted and the tabbox is empty afterwards. This hopefully resolves the crashes when a window is closed during active effect. At least I was not able to reproduce a crash anymore. If further testing shows that it resolves the problem the patch will be backported to branch and to other window switching effects showing the same problem.

CCBUG: 182358

svn path=/trunk/KDE/kdebase/workspace/; revision=919075
This commit is contained in:
Martin Gräßlin 2009-01-31 13:23:58 +00:00
parent 139b8c8f41
commit 7cb7f17a11
2 changed files with 20 additions and 0 deletions

View file

@ -101,6 +101,8 @@ void CoverSwitchEffect::prePaintScreen( ScreenPrePaintData& data, int time )
(dynamicThumbnails && effects->currentTabBoxWindowList().size() >= thumbnailWindows)) )
calculateItemSizes();
}
if( effects->currentTabBoxWindow() == NULL )
abort();
}
effects->prePaintScreen(data, time);
}
@ -1476,5 +1478,22 @@ void CoverSwitchEffect::windowInputMouseEvent( Window w, QEvent* e )
}
}
void CoverSwitchEffect::abort()
{
effects->unrefTabBox();
effects->setActiveFullScreenEffect( 0 );
effects->destroyInputWindow( input );
mActivated = false;
stop = false;
stopRequested = false;
effects->addRepaintFull();
if( thumbnails && (!dynamicThumbnails ||
(dynamicThumbnails && effects->currentTabBoxWindowList().size() >= thumbnailWindows)) )
{
qDeleteAll( windows );
windows.clear();
}
}
} // namespace

View file

@ -58,6 +58,7 @@ class CoverSwitchEffect
void paintWindowCover( EffectWindow* w, bool reflectedWindow, WindowPaintData& data );
void paintFrontWindow( EffectWindow* frontWindow, int width, int leftWindows, int rightWindows, bool reflectedWindow );
void paintWindows( QList< EffectWindow* >* windows, bool left, bool reflectedWindows, EffectWindow* additionalWindow = NULL );
void abort();
// thumbnail bar
class ItemInfo;
void calculateFrameSize();