diff options
author | Damien Plisson <damien.plisson@yahoo.fr> | 2010-02-01 14:20:01 +0300 |
---|---|---|
committer | Damien Plisson <damien.plisson@yahoo.fr> | 2010-02-01 14:20:01 +0300 |
commit | 7795e71377a6f21713eec5c579a52d2fd499e733 (patch) | |
tree | 15a837d7da1f7f3dff72c25bcfedf64faf1150b1 /intern/ghost | |
parent | e11f5d7d945207419d8c21b6f41a4af394079fbc (diff) |
Cocoa : fix mouse cursor hang when RMB-dragging in a not frontmost window
With continuous grab on, in 2+ window setup, when RMB-dragging an object in a 3D view of a not active (not frontmost) window, mouse cursor was stuck, with no escape.
Cursor grab must be done by the window that is key (able to receive mouse move events).
Diffstat (limited to 'intern/ghost')
-rw-r--r-- | intern/ghost/intern/GHOST_WindowCocoa.mm | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm index 5dcc949ed45..1223f866a9b 100644 --- a/intern/ghost/intern/GHOST_WindowCocoa.mm +++ b/intern/ghost/intern/GHOST_WindowCocoa.mm @@ -1100,6 +1100,7 @@ GHOST_TSuccess GHOST_WindowCocoa::setWindowCursorGrab(GHOST_TGrabCursorMode mode //No need to perform grab without warp as it is always on in OS X if(mode != GHOST_kGrabNormal) { GHOST_TInt32 x_old,y_old; + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; m_systemCocoa->getCursorPosition(x_old,y_old); screenToClient(x_old, y_old, m_cursorGrabInitPos[0], m_cursorGrabInitPos[1]); @@ -1110,8 +1111,13 @@ GHOST_TSuccess GHOST_WindowCocoa::setWindowCursorGrab(GHOST_TGrabCursorMode mode setWindowCursorVisibility(false); } + //Make window key if it wasn't to get the mouse move events + [m_window makeKeyWindow]; + //Dissociate cursor position even for warp mode, to allow mouse acceleration to work even when warping the cursor err = CGAssociateMouseAndMouseCursorPosition(false) == kCGErrorSuccess ? GHOST_kSuccess : GHOST_kFailure; + + [pool drain]; } } else { |