Workaround Wayland popup menu bug.

When hiding a child popup first the app receives ApplicationDeactivate
event and in a short time (a couple of ms) ApplicationActivate.

But the first event hides all popups, so the parent popup gets closed too.

Delay handling of ApplicationDeactivate event in this specific case.
This commit is contained in:
John Preston 2023-07-12 22:05:58 +04:00
parent 196447ac19
commit 51027a0bc2
2 changed files with 12 additions and 2 deletions

View File

@ -27,6 +27,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "base/qthelp_regex.h"
#include "ui/ui_utility.h"
#include "ui/effects/animations.h"
#include "ui/platform/ui_platform_utility.h"
#include <QtCore/QLockFile>
#include <QtGui/QSessionManager>
@ -580,9 +581,18 @@ void Sandbox::registerEnterFromEventLoop() {
}
bool Sandbox::notifyOrInvoke(QObject *receiver, QEvent *e) {
if (e->type() == base::InvokeQueuedEvent::kType) {
const auto type = e->type();
if (type == base::InvokeQueuedEvent::kType) {
static_cast<base::InvokeQueuedEvent*>(e)->invoke();
return true;
} else if (receiver == this) {
if (type == QEvent::ApplicationDeactivate) {
if (Ui::Platform::SkipApplicationDeactivateEvent()) {
return true;
}
} else if (type == QEvent::ApplicationActivate) {
Ui::Platform::GotApplicationActivateEvent();
}
}
return QApplication::notify(receiver, e);
}

@ -1 +1 @@
Subproject commit d04a38e15d957ab0dacfe825396c199541097443
Subproject commit 8db6dcf125da5c767d36a696794d4a51d82c7955