Reactive main window only if app is active.

Otherwise when we choose "Show in Folder" app looses focus,
then destroys PopupMenu and instantly regains focus back.
This commit is contained in:
John Preston 2018-10-25 13:01:01 +04:00
parent 8000ff2cd7
commit 550b67236e

View File

@ -503,12 +503,14 @@ PopupMenu::~PopupMenu() {
delete submenu;
}
if (const auto parent = parentWidget()) {
if (qApp->focusWidget() != nullptr) {
crl::on_main(parent, [=] {
if (!parent->isHidden()) {
parent->activateWindow();
}
});
}
}
if (_destroyedCallback) {
_destroyedCallback();
}