mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2026-01-02 09:10:51 -05: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:
parent
fa239865f2
commit
0d3d5db87c
1 changed files with 5 additions and 3 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue