[Bf-blender-cvs] [ee4f3065096] master: Fix T85844: high pressure at start of line.

Nicholas Rishel noreply at git.blender.org
Tue Feb 23 22:31:31 CET 2021


Commit: ee4f306509679cf4aacb5367680f13044db60ea8
Author: Nicholas Rishel
Date:   Tue Feb 23 09:50:03 2021 -0800
Branches: master
https://developer.blender.org/rBee4f306509679cf4aacb5367680f13044db60ea8

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.

===================================================================

M	intern/ghost/intern/GHOST_SystemWin32.cpp

===================================================================

diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp
index e7a72136bc6..45944d4d889 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(
@@ -1476,46 +1478,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;



More information about the Bf-blender-cvs mailing list