Fix [#21689] for coordinate issue (y flipped) when setting mouse cursor position

Mem leak when using BGE fixed too.
This commit is contained in:
Damien Plisson
2010-03-28 19:42:08 +00:00
parent 751a9975e4
commit dc4ac8a263
2 changed files with 4 additions and 0 deletions

View File

@@ -813,6 +813,7 @@ GHOST_TSuccess GHOST_SystemCocoa::setCursorPosition(GHOST_TInt32 x, GHOST_TInt32
GHOST_WindowCocoa* window = (GHOST_WindowCocoa*)m_windowManager->getActiveWindow();
if (!window) return GHOST_kFailure;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSScreen *windowScreen = window->getScreen();
NSRect screenRect = [windowScreen frame];
@@ -825,6 +826,7 @@ GHOST_TSuccess GHOST_SystemCocoa::setCursorPosition(GHOST_TInt32 x, GHOST_TInt32
CGDisplayMoveCursorToPoint((CGDirectDisplayID)[[[windowScreen deviceDescription] objectForKey:@"NSScreenNumber"] unsignedIntValue], CGPointMake(xf, yf));
[pool drain];
return GHOST_kSuccess;
}