disable warping for tablet events (X11 only), added TODO's for OSX and win32.
authorCampbell Barton <ideasman42@gmail.com>
Sun, 6 May 2012 15:45:48 +0000 (15:45 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 6 May 2012 15:45:48 +0000 (15:45 +0000)
intern/ghost/intern/GHOST_SystemCocoa.mm
intern/ghost/intern/GHOST_SystemWin32.cpp
intern/ghost/intern/GHOST_SystemX11.cpp

index 50d8cfd074baf6dcaef1c054e33a8560441a5ff8..898171b344ec86e5a08310be62f7745ac0917a9e 100644 (file)
@@ -1488,7 +1488,19 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
                        }
                        
                case NSMouseMoved:
                        }
                        
                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;
                                        case GHOST_kGrabHide: //Cursor hidden grab operation : no cursor move
                                        {
                                                GHOST_TInt32 x_warp, y_warp, x_accum, y_accum, x, y;
index 2d8cf13ac4fd775d3681ce0693abf9ef68a0d1ee..b00ff690cfa50376dceddefa3b05a079752a7349 100644 (file)
@@ -649,7 +649,12 @@ GHOST_EventCursor* GHOST_SystemWin32::processCursorEvent(GHOST_TEventType type,
        
        system->getCursorPosition(x_screen, y_screen);
 
        
        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;
        {
                GHOST_TInt32 x_new= x_screen;
                GHOST_TInt32 y_new= y_screen;
index 857d9e79e57e1df1c10085163e6bd024a2300dc6..6a2e6f59717b094c0dbb96b471db04b0c15dcad2 100644 (file)
@@ -471,8 +471,16 @@ GHOST_SystemX11::processEvent(XEvent *xe)
                case MotionNotify:
                {
                        XMotionEvent &xme = xe->xmotion;
                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;
                        {
                                GHOST_TInt32 x_new= xme.x_root;
                                GHOST_TInt32 y_new= xme.y_root;