summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorOliver Wolff <oliver.wolff@qt.io>2018-02-01 09:07:32 +0100
committerOliver Wolff <oliver.wolff@qt.io>2018-02-12 07:39:56 +0000
commit4ea42798750f409f701b97a25bb0c4a2c6248ba3 (patch)
tree1897be99f0d6351842cbc4f703a99c9ffeba07a0 /src/plugins
parent675603a853d7159592b1e120be15309ebceda4ad (diff)
winrt: Fix mouse releases that happen outside a window
If the mouse button is released outside of a window, we did not trigger a mouse release event. Task-number: QTBUG-66088 Change-Id: I3ef6234cc922c8c59ac3aa6350783fae4ba36bda Reviewed-by: Andre de la Rocha <andre.rocha@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/winrt/qwinrtscreen.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/platforms/winrt/qwinrtscreen.cpp b/src/plugins/platforms/winrt/qwinrtscreen.cpp
index 1a5af22814..97e54d496a 100644
--- a/src/plugins/platforms/winrt/qwinrtscreen.cpp
+++ b/src/plugins/platforms/winrt/qwinrtscreen.cpp
@@ -1215,6 +1215,12 @@ HRESULT QWinRTScreen::onPointerUpdated(ICoreWindow *, IPointerEventArgs *args)
QWindowSystemInterface::handleMouseEvent(d->currentPressWindow, localPressPos, pos, buttons, mods);
d->currentPressWindow = nullptr;
}
+ // If the mouse button is released outside of a window, targetWindow is 0, but the event
+ // has to be delivered to the window, that initially received the mouse press.
+ if (buttons == Qt::NoButton && d->currentPressWindow && !targetWindow) {
+ targetWindow = d->currentPressWindow;
+ d->currentPressWindow = nullptr;
+ }
QWindowSystemInterface::handleMouseEvent(targetWindow, localPos, pos, buttons, mods);