summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorShootingStarDragons <ShootingStarDragons@protonmail.com>2023-01-26 20:34:38 +0800
committerShootingStarDragons <ShootingStarDragons@protonmail.com>2023-01-26 20:34:38 +0800
commitc893dfd102c6cf07aa7d10d461d5e2ca81034310 (patch)
tree34fda8bee50eb4014cf2e9b69cdc438a3d87283f /src
parentfeat: hide all popup menus when press leftbutton on somewhere else (diff)
downloadnheko-c893dfd102c6cf07aa7d10d461d5e2ca81034310.tar.xz
chore: limit it to linux wayland
Diffstat (limited to 'src')
-rw-r--r--src/MainWindow.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp
index 5c92fb5b..3fedbdc0 100644
--- a/src/MainWindow.cpp
+++ b/src/MainWindow.cpp
@@ -363,9 +363,13 @@ MainWindow::event(QEvent *event)
 void
 MainWindow::mousePressEvent(QMouseEvent *event)
 {
-    if (event->button() == Qt::LeftButton) {
-        emit hideMenu();
+#if defined(Q_OS_LINUX)
+    if (QGuiApplication::platformName() == "wayland") {
+        if (event->button() == Qt::LeftButton) {
+            emit hideMenu();
+        }
     }
+#endif
     return QQuickView::mousePressEvent(event);
 }