diff --git a/effects/coverswitch.cpp b/effects/coverswitch.cpp index b7369a1990..de232cc4a5 100644 --- a/effects/coverswitch.cpp +++ b/effects/coverswitch.cpp @@ -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 diff --git a/effects/coverswitch.h b/effects/coverswitch.h index 1ee04e6dfb..3014ed386f 100644 --- a/effects/coverswitch.h +++ b/effects/coverswitch.h @@ -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();