diff options
author | Nicholas Rishel <rishel.nick@gmail.com> | 2021-07-09 10:00:55 +0300 |
---|---|---|
committer | Nicholas Rishel <rishel.nick@gmail.com> | 2021-07-09 10:03:45 +0300 |
commit | f07f069ce26832a21c50c8d5de50925009f3d33a (patch) | |
tree | ab4cb7b15e237040b6571590c3ac6c22998fc838 | |
parent | 237cecade9c4ab50b73f571b3bdfc0f91732509a (diff) |
Add signal for end of tablet input to x11 and cocoa.wintab_fallback_walknav
-rw-r--r-- | intern/ghost/intern/GHOST_SystemCocoa.mm | 12 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_SystemX11.cpp | 14 |
2 files changed, 26 insertions, 0 deletions
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 |