From a080accdb67e53010e31e4fe647d91cdd73d3b2a Mon Sep 17 00:00:00 2001 From: Nicholas Rishel Date: Mon, 25 May 2020 21:10:17 -0700 Subject: When there are not associated button events, assume there is no button events until one is found. This prevents errant cursor moves that occur before the Wintab button event is reported. We need to skip these events because if no button event exists, we generate one assuming it will either arrive later in the Wintab queue or that the button was from a non-Wintab device. For the case that this was generated by a non-wintab device, such as buttons mapped to mouse on the tablet pad, these cursor move events can significantly move the cursor from the intended click position. Signed-off-by: Nicholas Rishel --- intern/ghost/intern/GHOST_SystemWin32.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'intern') diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp index e40934dd1ad..34d4940de1d 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.cpp +++ b/intern/ghost/intern/GHOST_SystemWin32.cpp @@ -990,7 +990,10 @@ GHOST_TSuccess GHOST_SystemWin32::processWintabEvents(GHOST_TEventType type, * skip those and find the last button down mapped to mouse buttons. */ if (!window->wintabSysButPressed()) { - for (auto it = wtiIter; it != wintabInfo.end(); it++) { + // Assume there may be no button down event currently in the queue. + wtiIter = wintabInfo.end(); + + for (auto it = wintabInfo.begin(); it != wintabInfo.end(); it++) { if (it->type == GHOST_kEventButtonDown) { wtiIter = it; } -- cgit v1.2.3