Commit 7cb7f17a authored by Martin Flöser's avatar Martin Flöser
Browse files

Abort effect if the current tab box window is deleted and the tabbox is empty...

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
parent 139b8c8f
......@@ -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
......@@ -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();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment