Read Felix' comment here: https://invent.kde.org/system/dolphin/-/merge_requests/679#note_835657
In short:
> The above change moves the `m_view->setFocus()` towards a point in time in
> which `DolphinViewContainer`'s selection mode state is consistent again.
BUG:478724
}
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);
+
+ if (m_selectionModeTopBar->isAncestorOf(QApplication::focusWidget()) || m_selectionModeBottomBar->isAncestorOf(QApplication::focusWidget())) {
+ m_view->setFocus();
+ }
return;
}