Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/keepassxreboot/keepassxc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJCallicoat <jordan.callicoat@gmail.com>2021-01-20 06:06:57 +0300
committerJonathan White <support@dmapps.us>2021-01-20 23:37:12 +0300
commit0d3d5db87cb9710bb1ed5496ea5f0d2cd79d3a95 (patch)
treec666628714c70d61d5b7a01f928029808f2f5454
parentfa239865f27cedb67e9e99af558f8b110ce8f78c (diff)
Fix menubar click-to-move window with Qt 5.15
Change logic in click handler in eventFilter so that startSystemMove() is only called when there is no menubar action under the mouse cursor (i.e., when a blank area of the menubar is clicked). Fixes #5925
-rw-r--r--src/gui/MainWindow.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp
index d1eb1fe17..5b3c5c9b6 100644
--- a/src/gui/MainWindow.cpp
+++ b/src/gui/MainWindow.cpp
@@ -1784,9 +1784,11 @@ bool MainWindowEventFilter::eventFilter(QObject* watched, QEvent* event)
if (event->type() == QEvent::MouseButtonPress) {
if (watched == mainWindow->m_ui->menubar) {
- mainWindow->windowHandle()->startSystemMove();
- // Continue processing events, so menus keep working.
- return false;
+ auto* m = static_cast<QMouseEvent*>(event);
+ if (!mainWindow->m_ui->menubar->actionAt(m->pos())) {
+ mainWindow->windowHandle()->startSystemMove();
+ return false;
+ }
} else if (watched == mainWindow->m_ui->toolBar) {
if (!mainWindow->m_ui->toolBar->isMovable() || mainWindow->m_ui->toolBar->cursor() != Qt::SizeAllCursor) {
mainWindow->windowHandle()->startSystemMove();