Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Plisson <damien.plisson@yahoo.fr>2010-03-28 23:42:08 +0400
committerDamien Plisson <damien.plisson@yahoo.fr>2010-03-28 23:42:08 +0400
commitdc4ac8a263dae68f2563c44c4b6a44944f0053fe (patch)
treeb51814143bee38315bdf9977fcd00547e82a1a58
parent751a9975e4c633e1ea8818c1f2f07fd6020c0ec0 (diff)
Fix [#21689] for coordinate issue (y flipped) when setting mouse cursor position
Mem leak when using BGE fixed too.
-rw-r--r--intern/ghost/intern/GHOST_SystemCocoa.mm2
-rw-r--r--source/blender/windowmanager/intern/wm_window.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm
index 20d5cc7165a..b66b1e4033d 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.mm
+++ b/intern/ghost/intern/GHOST_SystemCocoa.mm
@@ -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;
}
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index ea41f03d864..150e6db35cb 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -1057,7 +1057,9 @@ void WM_cursor_warp(wmWindow *win, int x, int y)
if (win && win->ghostwin) {
int oldx=x, oldy=y;
+#if !defined(__APPLE__) || !defined(GHOST_COCOA)
y= win->sizey -y - 1;
+#endif
GHOST_ClientToScreen(win->ghostwin, x, y, &x, &y);
GHOST_SetCursorPosition(g_system, x, y);