2 files changed, 16 insertions, 0 deletions
diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp
index dcb4be49..8c2b4c35 100644
--- a/src/MainWindow.cpp
+++ b/src/MainWindow.cpp
@@ -359,6 +359,18 @@ MainWindow::event(QEvent *event)
return QQuickView::event(event);
}
+// HACK: https://bugreports.qt.io/browse/QTBUG-83972, qtwayland cannot auto hide menu
+void
+MainWindow::mousePressEvent(QMouseEvent *event)
+{
+#if defined(Q_OS_LINUX)
+ if (QGuiApplication::platformName() == "wayland") {
+ emit hideMenu();
+ }
+#endif
+ return QQuickView::mousePressEvent(event);
+}
+
void
MainWindow::restoreWindowSize()
{
diff --git a/src/MainWindow.h b/src/MainWindow.h
index 1664f849..bb23ff11 100644
--- a/src/MainWindow.h
+++ b/src/MainWindow.h
@@ -69,6 +69,8 @@ public:
protected:
void closeEvent(QCloseEvent *event);
bool event(QEvent *event) override;
+ // HACK: https://bugreports.qt.io/browse/QTBUG-83972, qtwayland cannot auto hide menu
+ void mousePressEvent(QMouseEvent *) override;
private slots:
//! Handle interaction with the tray icon.
@@ -77,6 +79,8 @@ private slots:
virtual void setWindowTitle(int notificationCount);
signals:
+ // HACK: https://bugreports.qt.io/browse/QTBUG-83972, qtwayland cannot auto hide menu
+ void hideMenu();
void reload();
void secretsChanged();
|