From 7e5b35935e0b85943de10ab80b54a4b77b3559b6 Mon Sep 17 00:00:00 2001 From: Dmitry Kazakov Date: Sat, 30 Mar 2019 23:14:07 +0300 Subject: [PATCH] Fix generation of Leave events when using tablet devices When both mouse and tablet events are handled by QWindowsPointerHandler, m_currentWindow variable is shared among the two event streams, therefore each stream should ensure it does equivalent operations, when changing it. Here we should subscribe to the Leave events, when we emit Enter event from the inside of the tablet events flow. Without whis subscription, the cursor may stuck in "resize" state when crossing the window's frame multiple times. Change-Id: I88df4a42ae86243e10ecd4a4cedf87639c96d169 Reviewed-by: Andre de la Rocha --- src/plugins/platforms/windows/qwindowspointerhandler.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/platforms/windows/qwindowspointerhandler.cpp b/src/plugins/platforms/windows/qwindowspointerhandler.cpp index 9a8b5d51215..501b62e07a5 100644 --- a/src/plugins/platforms/windows/qwindowspointerhandler.cpp +++ b/src/plugins/platforms/windows/qwindowspointerhandler.cpp @@ -614,6 +614,9 @@ bool QWindowsPointerHandler::translatePenEvent(QWindow *window, HWND hwnd, QtWin if (m_needsEnterOnPointerUpdate) { m_needsEnterOnPointerUpdate = false; if (window != m_currentWindow) { + // make sure we subscribe to leave events for this window + trackLeave(hwnd); + QWindowSystemInterface::handleEnterEvent(window, localPos, globalPos); m_currentWindow = window; if (QWindowsWindow *wumPlatformWindow = QWindowsWindow::windowsWindowOf(target))