[Bf-blender-cvs] [b1e90240819] wintab_fallback_walknav: Fix T83930 and Fix T84659: Walk navigation tablet bugs.

Nicholas Rishel noreply at git.blender.org
Fri Jul 9 09:04:44 CEST 2021


Commit: b1e902408191b0e813bbbe9473ed8aea1beee5a3
Author: Nicholas Rishel
Date:   Fri Jun 18 20:38:34 2021 -0700
Branches: wintab_fallback_walknav
https://developer.blender.org/rBb1e902408191b0e813bbbe9473ed8aea1beee5a3

Fix T83930 and Fix T84659: Walk navigation tablet bugs.

Fixes T83930, allowing walk navigation to continue without jumping back
after repositioning pen.

Fixes T84659, allow walk navigation to start (for Windows Ink) from
keyboard shortcut when pen is in use.

Maniphest Tasks: T84659, T83930

Differential Revision: https://developer.blender.org/D11651

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

M	intern/ghost/intern/GHOST_SystemWin32.cpp
M	source/blender/editors/space_view3d/view3d_navigate_walk.c

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

diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp
index 91de0e79cf2..b2479211f19 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.cpp
+++ b/intern/ghost/intern/GHOST_SystemWin32.cpp
@@ -1596,6 +1596,17 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
             }
             else {
               wt->leaveRange();
+
+              /* Send mouse event to signal end of tablet tracking to operators. */
+              DWORD msgPos = ::GetMessagePos();
+              int x = GET_X_LPARAM(msgPos);
+              int y = GET_Y_LPARAM(msgPos);
+              event = new GHOST_EventCursor(system->getMilliSeconds(),
+                                            GHOST_kEventCursorMove,
+                                            window,
+                                            x,
+                                            y,
+                                            GHOST_TABLET_DATA_NONE);
             }
           }
           eventHandled = true;
@@ -1635,6 +1646,18 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
           /* Reset pointer pen info if pen device has left tracking range. */
           if (pointerInfo.pointerType == PT_PEN) {
             window->resetPointerPenInfo();
+
+            /* Send mouse event to signal end of tablet tracking to operators. */
+            DWORD msgPos = ::GetMessagePos();
+            int x = GET_X_LPARAM(msgPos);
+            int y = GET_Y_LPARAM(msgPos);
+            event = new GHOST_EventCursor(system->getMilliSeconds(),
+                                          GHOST_kEventCursorMove,
+                                          window,
+                                          x,
+                                          y,
+                                          GHOST_TABLET_DATA_NONE);
+
             eventHandled = true;
           }
           break;
diff --git a/source/blender/editors/space_view3d/view3d_navigate_walk.c b/source/blender/editors/space_view3d/view3d_navigate_walk.c
index 613f58a8143..120a7016f73 100644
--- a/source/blender/editors/space_view3d/view3d_navigate_walk.c
+++ b/source/blender/editors/space_view3d/view3d_navigate_walk.c
@@ -693,6 +693,9 @@ static void walkEvent(bContext *C, WalkInfo *walk, const wmEvent *event)
       if ((walk->center_mval[0] == event->mval[0]) && (walk->center_mval[1] == event->mval[1])) {
         walk->is_cursor_first = false;
       }
+      else if (event->tablet.is_motion_absolute) {
+        walk->is_cursor_first = false;
+      }
       else {
         /* NOTE: its possible the system isn't giving us the warp event
          * ideally we shouldn't have to worry about this, see: T45361 */
@@ -704,11 +707,15 @@ static void walkEvent(bContext *C, WalkInfo *walk, const wmEvent *event)
       return;
     }
 
-    if ((walk->is_cursor_absolute == false) && event->tablet.is_motion_absolute) {
+    if (!walk->is_cursor_absolute && event->tablet.is_motion_absolute) {
       walk->is_cursor_absolute = true;
       copy_v2_v2_int(walk->prev_mval, event->mval);
       copy_v2_v2_int(walk->center_mval, event->mval);
     }
+    else if (walk->is_cursor_absolute && !event->tablet.is_motion_absolute) {
+      walk->is_cursor_absolute = false;
+      walk->is_cursor_first = true;
+    }
 #endif /* USE_TABLET_SUPPORT */
 
     walk->moffset[0] += event->mval[0] - walk->prev_mval[0];



More information about the Bf-blender-cvs mailing list