mirror of
https://github.com/telegramdesktop/tdesktop
synced 2024-12-26 00:12:25 +00:00
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:
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();
|
||||
|
Loading…
Reference in New Issue
Block a user