disable warping for tablet events (X11 only), added TODO's for OSX and win32.

This commit is contained in:
Campbell Barton 2012-05-06 15:45:48 +00:00
parent a058ac9c50
commit 4504c66124
3 changed files with 29 additions and 4 deletions

@ -1488,7 +1488,19 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
}
case NSMouseMoved:
switch (window->getCursorGrabMode()) {
GHOST_TGrabCursorMode grab_mode = window->getCursorGrabMode();
/* TODO: CHECK IF THIS IS A TABLET EVENT */
bool is_tablet = false;
if (is_tablet &&
(grab_mode != GHOST_kGrabDisable) &&
(grab_mode != GHOST_kGrabNormal))
{
grab_mode = GHOST_kGrabDisable;
}
switch (grab_mode) {
case GHOST_kGrabHide: //Cursor hidden grab operation : no cursor move
{
GHOST_TInt32 x_warp, y_warp, x_accum, y_accum, x, y;

@ -649,7 +649,12 @@ GHOST_EventCursor* GHOST_SystemWin32::processCursorEvent(GHOST_TEventType type,
system->getCursorPosition(x_screen, y_screen);
if(window->getCursorGrabMode() != GHOST_kGrabDisable && window->getCursorGrabMode() != GHOST_kGrabNormal)
/* TODO: CHECK IF THIS IS A TABLET EVENT */
bool is_tablet = false;
if (is_tablet == false &&
window->getCursorGrabMode() != GHOST_kGrabDisable &&
window->getCursorGrabMode() != GHOST_kGrabNormal)
{
GHOST_TInt32 x_new= x_screen;
GHOST_TInt32 y_new= y_screen;

@ -471,8 +471,16 @@ GHOST_SystemX11::processEvent(XEvent *xe)
case MotionNotify:
{
XMotionEvent &xme = xe->xmotion;
if(window->getCursorGrabMode() != GHOST_kGrabDisable && window->getCursorGrabMode() != GHOST_kGrabNormal)
#ifdef WITH_X11_XINPUT
bool is_tablet = window->GetXTablet().CommonData.Active != GHOST_kTabletModeNone;
#else
bool is_tablet = false;
#endif
if(is_tablet == false &&
window->getCursorGrabMode() != GHOST_kGrabDisable &&
window->getCursorGrabMode() != GHOST_kGrabNormal)
{
GHOST_TInt32 x_new= xme.x_root;
GHOST_TInt32 y_new= xme.y_root;