mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-12-04 15:39:34 +01:00
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
This commit is contained in:
committed by
Jonathan White
parent
fa239865f2
commit
0d3d5db87c
@@ -1784,9 +1784,11 @@ bool MainWindowEventFilter::eventFilter(QObject* watched, QEvent* event)
|
|||||||
|
|
||||||
if (event->type() == QEvent::MouseButtonPress) {
|
if (event->type() == QEvent::MouseButtonPress) {
|
||||||
if (watched == mainWindow->m_ui->menubar) {
|
if (watched == mainWindow->m_ui->menubar) {
|
||||||
mainWindow->windowHandle()->startSystemMove();
|
auto* m = static_cast<QMouseEvent*>(event);
|
||||||
// Continue processing events, so menus keep working.
|
if (!mainWindow->m_ui->menubar->actionAt(m->pos())) {
|
||||||
return false;
|
mainWindow->windowHandle()->startSystemMove();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
} else if (watched == mainWindow->m_ui->toolBar) {
|
} else if (watched == mainWindow->m_ui->toolBar) {
|
||||||
if (!mainWindow->m_ui->toolBar->isMovable() || mainWindow->m_ui->toolBar->cursor() != Qt::SizeAllCursor) {
|
if (!mainWindow->m_ui->toolBar->isMovable() || mainWindow->m_ui->toolBar->cursor() != Qt::SizeAllCursor) {
|
||||||
mainWindow->windowHandle()->startSystemMove();
|
mainWindow->windowHandle()->startSystemMove();
|
||||||
|
|||||||
Reference in New Issue
Block a user