When a user exits selection mode for example by clicking the "Exit
Selection Mode" button, the bar is closed but the focus doesn't return
to the view which would be expected. This commit actively moves the
focus to the view in such a scenario.
BUG: 469621
#include <KProtocolManager>
#include <KShell>
+#include <QApplication>
#include <QDesktopServices>
#include <QDropEvent>
#include <QGridLayout>
}
Q_CHECK_PTR(m_selectionModeTopBar); // there is no point in disabling selectionMode when it wasn't even enabled once.
Q_CHECK_PTR(m_selectionModeBottomBar);
+ if (m_selectionModeTopBar->isAncestorOf(QApplication::focusWidget()) || m_selectionModeBottomBar->isAncestorOf(QApplication::focusWidget())) {
+ m_view->setFocus();
+ }
m_selectionModeTopBar->setVisible(false, WithAnimation);
m_selectionModeBottomBar->setVisible(false, WithAnimation);
Q_EMIT selectionModeChanged(false);