summary refs log tree commit diff
path: root/src/MainWindow.cpp
diff options
context:
space:
mode:
authorDeepBlueV7.X <nicolas.werner@hotmail.de>2023-01-28 12:15:54 +0100
committerGitHub <noreply@github.com>2023-01-28 12:15:54 +0100
commit3abb49c4a2338f1d07ca68e27f3030b1a6f2a97f (patch)
tree2434425ffa8a55614e62eb4ccc8bc50c197d29c7 /src/MainWindow.cpp
parentMake newline behave consistently in markdown mode (diff)
parentchore: remove button check (diff)
downloadnheko-3abb49c4a2338f1d07ca68e27f3030b1a6f2a97f.tar.xz
Merge pull request #1319 from Decodetalkers/menuhideonwayland
feat: hide all popup menus when press leftbutton on somewhere else
Diffstat (limited to 'src/MainWindow.cpp')
-rw-r--r--src/MainWindow.cpp12
1 files changed, 12 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() {