Cocoa : bugfix on continuous grab (cursor was returning to a wrong position upon...
authorDamien Plisson <damien.plisson@yahoo.fr>
Wed, 14 Oct 2009 08:24:40 +0000 (08:24 +0000)
committerDamien Plisson <damien.plisson@yahoo.fr>
Wed, 14 Oct 2009 08:24:40 +0000 (08:24 +0000)
intern/ghost/intern/GHOST_WindowCocoa.mm

index fd68b6200eefef220e1e276649f620a8781207bb..999ec0de9c1600743cad0e8ec8733600f54b8c58 100644 (file)
@@ -873,7 +873,10 @@ GHOST_TSuccess GHOST_WindowCocoa::setWindowCursorGrab(bool grab, bool warp, bool
                                setCursorWarpAccum(-x_new, -y_new);
                        }
                        else {
-                               m_systemCocoa->setCursorPosition(m_cursorWarpInitPos[0], m_cursorWarpInitPos[1]);
+                               GHOST_TInt32 x_new, y_new;
+                               //get/set cursor position works in screen coordinates
+                               clientToScreen(m_cursorWarpInitPos[0], m_cursorWarpInitPos[1], x_new, y_new);
+                               m_systemCocoa->setCursorPosition(x_new, y_new);
                                setCursorWarpAccum(0, 0);
                        }