[Bf-blender-cvs] [f07f069ce26] wintab_fallback_walknav: Add signal for end of tablet input to x11 and cocoa.
Nicholas Rishel
noreply at git.blender.org
Fri Jul 9 09:04:44 CEST 2021
Commit: f07f069ce26832a21c50c8d5de50925009f3d33a
Author: Nicholas Rishel
Date: Fri Jul 9 00:00:55 2021 -0700
Branches: wintab_fallback_walknav
https://developer.blender.org/rBf07f069ce26832a21c50c8d5de50925009f3d33a
Add signal for end of tablet input to x11 and cocoa.
===================================================================
M intern/ghost/intern/GHOST_SystemCocoa.mm
M intern/ghost/intern/GHOST_SystemX11.cpp
===================================================================
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm
index 0f10d5815f4..8797740a2b5 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.mm
+++ b/intern/ghost/intern/GHOST_SystemCocoa.mm
@@ -1446,6 +1446,18 @@ GHOST_TSuccess GHOST_SystemCocoa::handleTabletEvent(void *eventPtr, short eventT
break;
}
}
+ else {
+ /* Send mouse event to signal end of tablet tracking to operators. */
+ int32_t x, y;
+ if (getCursorPosition(x, y)) {
+ pushEvent(new GHOST_EventCursor([event timestamp] * 1000,
+ GHOST_kEventCursorMove,
+ window,
+ x,
+ y,
+ GHOST_TABLET_DATA_NONE));
+ }
+ }
break;
default:
diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp
index 172fcbeb3de..5c2bfca3c0a 100644
--- a/intern/ghost/intern/GHOST_SystemX11.cpp
+++ b/intern/ghost/intern/GHOST_SystemX11.cpp
@@ -943,6 +943,13 @@ void GHOST_SystemX11::processEvent(XEvent *xe)
if (!any_proximity) {
// printf("proximity disable\n");
window->GetTabletData().Active = GHOST_kTabletModeNone;
+
+ /* Send mouse event to signal end of tablet tracking to operators. */
+ int32_t x, y;
+ if (getCursorPosition(x, y)) {
+ pushEvent(new GHOST_EventCursor(
+ getMilliSeconds(), GHOST_kEventCursorMove, window, x, y, GHOST_TABLET_DATA_NONE));
+ }
}
}
#endif /* WITH_X11_XINPUT */
@@ -1558,6 +1565,13 @@ void GHOST_SystemX11::processEvent(XEvent *xe)
}
else if (xe->type == xtablet.ProxOutEvent) {
window->GetTabletData().Active = GHOST_kTabletModeNone;
+
+ /* Send mouse event to signal end of tablet tracking to operators. */
+ int32_t x, y;
+ if (getCursorPosition(x, y)) {
+ pushEvent(new GHOST_EventCursor(
+ getMilliSeconds(), GHOST_kEventCursorMove, window, x, y, GHOST_TABLET_DATA_NONE));
+ }
}
}
#endif // WITH_X11_XINPUT
More information about the Bf-blender-cvs
mailing list