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
@@ -503,11 +503,13 @@ PopupMenu::~PopupMenu() {
delete submenu;
}
if (const auto parent = parentWidget()) {
crl::on_main(parent, [=] {
if (!parent->isHidden()) {
parent->activateWindow();
}
});
if (qApp->focusWidget() != nullptr) {
crl::on_main(parent, [=] {
if (!parent->isHidden()) {
parent->activateWindow();
}
});
}
}
if (_destroyedCallback) {
_destroyedCallback();