From 4670630e2262d6df5448400f3b4d88cbb7e1ca25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Thu, 17 Oct 2019 22:02:44 +0200 Subject: [PATCH] A much better windows popup close handling --- src/GUI/popup.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/GUI/popup.cpp b/src/GUI/popup.cpp index 0e2afd8a..4a0c2d69 100644 --- a/src/GUI/popup.cpp +++ b/src/GUI/popup.cpp @@ -35,7 +35,8 @@ private: Label *Label::_instance = 0; Label::Label(const QString &text, QWidget *parent) - : QLabel(text, parent, Qt::ToolTip | Qt::BypassGraphicsProxyWidget) + : QLabel(text, parent, Qt::ToolTip | Qt::BypassGraphicsProxyWidget + | Qt::WindowDoesNotAcceptFocus) { delete _instance; _instance = this; @@ -98,18 +99,10 @@ bool Label::eventFilter(QObject *o, QEvent *ev) } break; } -#ifdef Q_OS_WIN32 - case QEvent::FocusOut: - case QEvent::WindowDeactivate: - if (o == this) - deleteLater(); - break; -#else // Q_OS_WIN32 case QEvent::FocusIn: case QEvent::FocusOut: case QEvent::WindowActivate: case QEvent::WindowDeactivate: -#endif // Q_OS_WIN32 case QEvent::Close: deleteLater(); break;