diff --git a/src/ViewContainer.cpp b/src/ViewContainer.cpp index 79993edc5..58774fbc1 100644 --- a/src/ViewContainer.cpp +++ b/src/ViewContainer.cpp @@ -430,7 +430,6 @@ TabbedViewContainer::TabbedViewContainer(NavigationPosition position , QObject* _tabBar->setDrawBase(true); _tabBar->setDocumentMode(true); _tabBar->setFocusPolicy(Qt::NoFocus); - _tabBar->setSelectionBehaviorOnRemove(QTabBar::SelectPreviousTab); _newTabButton = new QToolButton(_containerWidget); _newTabButton->setIcon(KIcon("tab-new")); diff --git a/src/ViewManager.cpp b/src/ViewManager.cpp index 3c5db04af..d5139a92f 100644 --- a/src/ViewManager.cpp +++ b/src/ViewManager.cpp @@ -360,8 +360,13 @@ void ViewManager::sessionFinished() Session* session = qobject_cast(sender()); - // We're using setSelectionBehaviorOnRemove(QTabBar::SelectPreviousTab) - // so no need to manually select next tab. + if ( _sessionMap[qobject_cast(activeView())] == session ) + { + // switch to the next view before deleting the session views to prevent flicker + // occurring as a result of an interval between removing the active view and switching + // to the next view + nextView(); + } Q_ASSERT(session);