From 0d4fd9c40239c9b1c9ebb891e6c2e36c40b3c73e Mon Sep 17 00:00:00 2001 From: Nicholas Rishel Date: Thu, 2 Dec 2021 21:41:00 -0800 Subject: Test fix. --- intern/ghost/intern/GHOST_SystemWin32.cpp | 1 + intern/ghost/intern/GHOST_Wintab.cpp | 6 ++++++ intern/ghost/intern/GHOST_Wintab.h | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp index e4630ad1ab5..d50adb266ce 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.cpp +++ b/intern/ghost/intern/GHOST_SystemWin32.cpp @@ -1607,6 +1607,7 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam, if (inRange) { /* Some devices don't emit WT_CSRCHANGE events, so update cursor info here. */ wt->updateCursorInfo(); + wt->enterRange(); } else { wt->leaveRange(); diff --git a/intern/ghost/intern/GHOST_Wintab.cpp b/intern/ghost/intern/GHOST_Wintab.cpp index cf0309b1521..5918dc4e2dd 100644 --- a/intern/ghost/intern/GHOST_Wintab.cpp +++ b/intern/ghost/intern/GHOST_Wintab.cpp @@ -247,6 +247,12 @@ void GHOST_Wintab::leaveRange() m_fpPacketsGet(m_context.get(), m_pkts.size(), m_pkts.data()); } +void GHOST_Wintab::enterRange() +{ + /* Placeholder to signal tablet in range, necessary to disable mouse input handling. */ + m_lastTabletData.Active = GHOST_kTabletModeStylus; +} + void GHOST_Wintab::remapCoordinates() { LOGCONTEXT lc = {0}; diff --git a/intern/ghost/intern/GHOST_Wintab.h b/intern/ghost/intern/GHOST_Wintab.h index a6c41bf5f64..ace44b7dd28 100644 --- a/intern/ghost/intern/GHOST_Wintab.h +++ b/intern/ghost/intern/GHOST_Wintab.h @@ -91,6 +91,11 @@ class GHOST_Wintab { */ void loseFocus(); + /** + * Updates tablet state to indicate tablet is in range. + */ + void enterRange(); + /** * Clean up when Wintab leaves tracking range. */ -- cgit v1.2.3