summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Rauter <[email protected]>2023-06-08 15:44:46 +0200
committerMatthias Rauter <[email protected]>2023-06-16 09:22:54 +0200
commitef7d809eaf3be2e162a274b48a6ac8051a51e86d (patch)
treec0f9f54f20a3779f98c4ff2e975836c8f4b3204b
parent7993321e7620941f3106acb977243c51aa27ceec (diff)
Send LeaveEvent as reaction to WM_POINTERLEAVE to reset hover states
Currently items can get stuck in a hovered state when all fingers are lifted from a touchscreen. This is because we don't react to the WM_POINTERLEAVE event from Windows. With this patch we translate a WM_POINTERLEAVE event to a LeaveEvent to remove the hover state from QtQuick items. Fixes: QTBUG-62912 Pick-to: 6.5 6.6 Change-Id: I8a6fb6b7ec77457854a75e20277565d1eb89bab6 Reviewed-by: Wladimir Leuschner <[email protected]> Reviewed-by: Jan Arve Sæther <[email protected]>
-rw-r--r--src/plugins/platforms/windows/qwindowspointerhandler.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/platforms/windows/qwindowspointerhandler.cpp b/src/plugins/platforms/windows/qwindowspointerhandler.cpp
index 9592caaabf4..4bd7577cf0c 100644
--- a/src/plugins/platforms/windows/qwindowspointerhandler.cpp
+++ b/src/plugins/platforms/windows/qwindowspointerhandler.cpp
@@ -441,6 +441,8 @@ bool QWindowsPointerHandler::translateTouchEvent(QWindow *window, HWND hwnd,
if (id != -1)
m_lastTouchPoints.remove(id);
}
+ // Send LeaveEvent to reset hover when the last finger leaves the touch screen (QTBUG-62912)
+ QWindowSystemInterface::handleEnterLeaveEvent(nullptr, window);
}
// Only handle down/up/update, ignore others like WM_POINTERENTER, WM_POINTERLEAVE, etc.