From 538a2ac58f4afe7e46cb2471d511280db8633f70 Mon Sep 17 00:00:00 2001 From: Nicholas Rishel Date: Wed, 15 Apr 2020 18:25:13 -0700 Subject: Allow double button up, otherwise there may be a trailing 0 pressure line. Signed-off-by: Nicholas Rishel --- intern/ghost/intern/GHOST_SystemWin32.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'intern/ghost') diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp index 703c0e42385..fb0c5f0507f 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.cpp +++ b/intern/ghost/intern/GHOST_SystemWin32.cpp @@ -1020,9 +1020,9 @@ GHOST_TSuccess GHOST_SystemWin32::processWintabEvents(GHOST_TEventType type, info.time, GHOST_kEventCursorMove, window, info.x, info.y, info.tabletData)); break; case GHOST_kEventButtonUp: + system->pushEvent( + new GHOST_EventButton(info.time, info.type, window, info.button, info.tabletData)); if (type == GHOST_kEventButtonUp && mask == info.button) { - system->pushEvent( - new GHOST_EventButton(info.time, info.type, window, info.button, info.tabletData)); unhandledButton = false; } window->updateWintabSysBut(MouseReleased); @@ -1033,6 +1033,10 @@ GHOST_TSuccess GHOST_SystemWin32::processWintabEvents(GHOST_TEventType type, } // No Wintab button found correlating to the system button event, handle it too. + // + // Wintab button up events may be handled during WM_MOUSEMOVE, before their corresponding + // WM_*BUTTONUP event has fired, which results in two GHOST Button up events for a single Wintab + // associated button event. Because Wintab and their associated Windows mouse events are handled asynchronously, and there's no way to turn off if (unhandledButton) { system->pushEvent(new GHOST_EventButton( system->getMilliSeconds(), type, window, mask, GHOST_TABLET_DATA_NONE)); -- cgit v1.2.3