diff options
author | Nicholas Rishel <rishel.nick@gmail.com> | 2021-02-23 20:50:03 +0300 |
---|---|---|
committer | Nicholas Rishel <rishel.nick@gmail.com> | 2021-02-23 22:27:40 +0300 |
commit | 37afeb7eaa8c2965fa4348b66b6ef600b7a3769a (patch) | |
tree | df46d2d40573f82b704389328546b1b8f3dbab9f | |
parent | cd9dbe317d59456fa10495d2cfc4db70e5cfc162 (diff) |
Fix T85844: high pressure at start of line.
m_tabletInRange is no longer set for Wintab after 2e81f2c01abd21fdbc
reverted Wintab changes. This reverts most button processing to
behavior present in 2.91.2.
Left in place is a bugfix for Windows Ink: button events while a
Windows Ink pen is in range should still be processed. Events processed
by Windows Ink and not passed to DefWindowProc do not create WM_*BUTTON
events, but button events from e.g. tablet pad express keys do create
WM_*BUTTON events and should be handled.
-rw-r--r-- | intern/ghost/intern/GHOST_SystemWin32.cpp | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp index 5d5ba90b299..c12fec4fe3c 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.cpp +++ b/intern/ghost/intern/GHOST_SystemWin32.cpp @@ -934,13 +934,15 @@ GHOST_EventButton *GHOST_SystemWin32::processButtonEvent(GHOST_TEventType type, { GHOST_SystemWin32 *system = (GHOST_SystemWin32 *)getSystem(); - GHOST_TabletData td = GHOST_TABLET_DATA_NONE; - - if (window->m_tabletInRange) { - td = window->getTabletData(); + if (type == GHOST_kEventButtonDown) { + window->updateMouseCapture(MousePressed); + } + else if (type == GHOST_kEventButtonUp) { + window->updateMouseCapture(MouseReleased); } - return new GHOST_EventButton(system->getMilliSeconds(), type, window, mask, td); + return new GHOST_EventButton( + system->getMilliSeconds(), type, window, mask, window->getTabletData()); } void GHOST_SystemWin32::processPointerEvent( @@ -1482,46 +1484,36 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam, // Mouse events, processed //////////////////////////////////////////////////////////////////////// case WM_LBUTTONDOWN: - window->updateMouseCapture(MousePressed); event = processButtonEvent(GHOST_kEventButtonDown, window, GHOST_kButtonMaskLeft); break; case WM_MBUTTONDOWN: - window->updateMouseCapture(MousePressed); event = processButtonEvent(GHOST_kEventButtonDown, window, GHOST_kButtonMaskMiddle); break; case WM_RBUTTONDOWN: - window->updateMouseCapture(MousePressed); event = processButtonEvent(GHOST_kEventButtonDown, window, GHOST_kButtonMaskRight); break; case WM_XBUTTONDOWN: if ((short)HIWORD(wParam) == XBUTTON1) { - window->updateMouseCapture(MousePressed); event = processButtonEvent(GHOST_kEventButtonDown, window, GHOST_kButtonMaskButton4); } else if ((short)HIWORD(wParam) == XBUTTON2) { - window->updateMouseCapture(MousePressed); event = processButtonEvent(GHOST_kEventButtonDown, window, GHOST_kButtonMaskButton5); } break; case WM_LBUTTONUP: - window->updateMouseCapture(MouseReleased); event = processButtonEvent(GHOST_kEventButtonUp, window, GHOST_kButtonMaskLeft); break; case WM_MBUTTONUP: - window->updateMouseCapture(MouseReleased); event = processButtonEvent(GHOST_kEventButtonUp, window, GHOST_kButtonMaskMiddle); break; case WM_RBUTTONUP: - window->updateMouseCapture(MouseReleased); event = processButtonEvent(GHOST_kEventButtonUp, window, GHOST_kButtonMaskRight); break; case WM_XBUTTONUP: if ((short)HIWORD(wParam) == XBUTTON1) { - window->updateMouseCapture(MouseReleased); event = processButtonEvent(GHOST_kEventButtonUp, window, GHOST_kButtonMaskButton4); } else if ((short)HIWORD(wParam) == XBUTTON2) { - window->updateMouseCapture(MouseReleased); event = processButtonEvent(GHOST_kEventButtonUp, window, GHOST_kButtonMaskButton5); } break; |