diff options
author | Nicholas Rishel <rishel.nick@gmail.com> | 2020-12-18 04:19:54 +0300 |
---|---|---|
committer | Nicholas Rishel <rishel.nick@gmail.com> | 2020-12-18 04:21:15 +0300 |
commit | f880fe2d66f1975880c21401246a5ff48f479314 (patch) | |
tree | 87f08f0c609e6274348682e7b1c118624ab4e6d2 /intern | |
parent | ef17fb2715a3f24cd5cddd6725bfef4858f87617 (diff) |
Fix T82288 Wintab walk navigation erratic.
Walk navigation relies on tablet data being set to detect if motion is
absolute. This patch sets tablet data in Ghost to dummy values when a
tablet pen is in range and not handled by Wintab processing.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/ghost/intern/GHOST_SystemWin32.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp index 2bf1d0c2d35..7e800619dda 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.cpp +++ b/intern/ghost/intern/GHOST_SystemWin32.cpp @@ -1151,6 +1151,8 @@ GHOST_EventCursor *GHOST_SystemWin32::processCursorEvent(GHOST_WindowWin32 *wind GHOST_TInt32 x_screen, y_screen; GHOST_SystemWin32 *system = (GHOST_SystemWin32 *)getSystem(); + GHOST_TabletData tabletData = GHOST_TABLET_DATA_NONE; + if (window->m_tabletInRange || window->wintabSysButPressed()) { if (window->useTabletAPI(GHOST_kTabletWintab) && processWintabEvent( @@ -1164,8 +1166,13 @@ GHOST_EventCursor *GHOST_SystemWin32::processCursorEvent(GHOST_WindowWin32 *wind return NULL; } - /* If using Wintab but no button event is currently active, - * fall through to default handling. */ + /* If using Wintab but no button event is currently active, fall through to default handling. + * + * Populate tablet data so that cursor is recognized as an absolute position device. */ + tabletData.Active = GHOST_kTabletModeStylus; + tabletData.Pressure = 0.0f; + tabletData.Xtilt = 0.0f; + tabletData.Ytilt = 0.0f; } system->getCursorPosition(x_screen, y_screen); @@ -1198,16 +1205,12 @@ GHOST_EventCursor *GHOST_SystemWin32::processCursorEvent(GHOST_WindowWin32 *wind window, x_screen + x_accum, y_screen + y_accum, - GHOST_TABLET_DATA_NONE); + tabletData); } } else { - return new GHOST_EventCursor(system->getMilliSeconds(), - GHOST_kEventCursorMove, - window, - x_screen, - y_screen, - GHOST_TABLET_DATA_NONE); + return new GHOST_EventCursor( + system->getMilliSeconds(), GHOST_kEventCursorMove, window, x_screen, y_screen, tabletData); } return NULL; } |