[Bf-blender-cvs] [46221219d88] fix-tablet-walk: Fix T83930 and Fix T84659: Walk navigation tablet bugs.

Nicholas Rishel noreply at git.blender.org
Sat Jun 19 06:34:23 CEST 2021


Commit: 46221219d880c8148f783788d88b712ec3d19ae0
Author: Nicholas Rishel
Date:   Fri Jun 18 20:38:34 2021 -0700
Branches: fix-tablet-walk
https://developer.blender.org/rB46221219d880c8148f783788d88b712ec3d19ae0

Fix T83930 and Fix T84659: Walk navigation tablet bugs.

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

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

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

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

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

diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp
index 09cfa30eca5..32c5dd2b885 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.cpp
+++ b/intern/ghost/intern/GHOST_SystemWin32.cpp
@@ -1601,6 +1601,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;
@@ -1640,6 +1651,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 && !IS_POINTER_INRANGE_WPARAM(wParam)) {
             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_walk.c b/source/blender/editors/space_view3d/view3d_walk.c
index ab4cf0c2135..d6686696eea 100644
--- a/source/blender/editors/space_view3d/view3d_walk.c
+++ b/source/blender/editors/space_view3d/view3d_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,13 +707,19 @@ 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);
       /* Without this we can't turn 180d with the default speed of 1.0. */
       walk->mouse_speed *= 4.0f;
     }
+    else if (walk->is_cursor_absolute && !event->tablet.is_motion_absolute) {
+        walk->is_cursor_absolute = false;
+        walk->is_cursor_first = true;
+        /* Return walk speed to normal. */
+        walk->mouse_speed = U.walk_navigation.mouse_speed;
+    }
 #endif /* USE_TABLET_SUPPORT */
 
     walk->moffset[0] += event->mval[0] - walk->prev_mval[0];



More information about the Bf-blender-cvs mailing list