summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2023-03-24 15:26:26 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-03-28 16:16:34 +0000
commitca128e25119c0b259d083567c796bfa67b100a42 (patch)
tree320328ab7ad14ac06ff039d56f28db34261392a8
parent1e393e82c905160ffabd98282aaa8901397ece2b (diff)
Windows: Send synthetic mouse release after move/resize using right API
The end of a move or resize might happen with the mouse still inside the non-client area of the window, in which case we correctly resolved the type to QEvent::NonClientAreaMouseButtonRelease, but we sent it via QWindowSystemInterface::handleMouseEvent, which sets nonClientArea of the event to false. This in turn resulted in QGuiApplication sending a synthetic QEvent::MouseMove in case the position was out of sync, instead of the correct QEvent::NonClientAreaMouseMove. This should really be cleaned up on the QWSI level, as there is no reason to have a dedicated API for handleFrameStrutMouseEvent, when handleMouseEvent already takes an event type, but for now we fix the immediate issue in the Windows platform plugin. Change-Id: I8a831f5f19adb0625b29b50ebce9c0c6514e93f3 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit b4afba0c3450fd0c14ec7bada098c4e82ca310e7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/plugins/platforms/windows/qwindowscontext.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp
index ed47ef2108..720350aeca 100644
--- a/src/plugins/platforms/windows/qwindowscontext.cpp
+++ b/src/plugins/platforms/windows/qwindowscontext.cpp
@@ -1596,9 +1596,13 @@ void QWindowsContext::handleExitSizeMove(QWindow *window)
? QEvent::MouseButtonRelease : QEvent::NonClientAreaMouseButtonRelease;
for (Qt::MouseButton button : {Qt::LeftButton, Qt::RightButton, Qt::MiddleButton}) {
if (appButtons.testFlag(button) && !currentButtons.testFlag(button)) {
- QWindowSystemInterface::handleMouseEvent(window, localPos, globalPos,
- currentButtons, button, type,
- keyboardModifiers);
+ if (type == QEvent::NonClientAreaMouseButtonRelease) {
+ QWindowSystemInterface::handleFrameStrutMouseEvent(window, localPos, globalPos,
+ currentButtons, button, type, keyboardModifiers);
+ } else {
+ QWindowSystemInterface::handleMouseEvent(window, localPos, globalPos,
+ currentButtons, button, type, keyboardModifiers);
+ }
}
}
if (d->m_systemInfo & QWindowsContext::SI_SupportsPointer)