qtquick|MDI: Fix resizing inner MDI dock widgets
It was flaky. The mouse move events came from global event filter but the mouse press came from the Frame's mouse area. Sometimes the QQuickWindow wouldn't deliver the press to the frame if it was done outside, while the moves were changing the cursor shape since we had a treshold Now we guarantee that whenever the cursor changes the resize will really happen
This commit is contained in:
@@ -104,9 +104,7 @@ bool WidgetResizeHandler::eventFilter(QObject *o, QEvent *e)
|
||||
}
|
||||
|
||||
if (!widget) {
|
||||
auto qquickWindow = qobject_cast<QQuickWindow*>(o);
|
||||
if (!(qquickWindow && e->type() == QEvent::MouseMove))
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,6 +116,7 @@ bool WidgetResizeHandler::eventFilter(QObject *o, QEvent *e)
|
||||
break;
|
||||
auto mouseEvent = static_cast<QMouseEvent *>(e);
|
||||
auto cursorPos = cursorPosition(Qt5Qt6Compat::eventGlobalPos(mouseEvent));
|
||||
updateCursor(cursorPos);
|
||||
if (cursorPos == CursorPosition_Undefined)
|
||||
return false;
|
||||
|
||||
@@ -135,6 +134,7 @@ bool WidgetResizeHandler::eventFilter(QObject *o, QEvent *e)
|
||||
}
|
||||
case QEvent::MouseButtonRelease: {
|
||||
m_resizingInProgress = false;
|
||||
updateCursor(CursorPosition_Undefined);
|
||||
auto mouseEvent = static_cast<QMouseEvent *>(e);
|
||||
|
||||
if (mTarget->isMaximized() || !m_resizingInProgress || mouseEvent->button() != Qt::LeftButton)
|
||||
|
||||
Reference in New Issue
Block a user