From 41287694cbf72bc9e86e009e5441f7a94df15239 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Mon, 17 Aug 2015 19:38:32 +0200 Subject: [PATCH] Replace convertBaseToScreen deprecated in 10.11 Closes #534. --- src/cocoa_window.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/cocoa_window.m b/src/cocoa_window.m index 69c37565..5387839f 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -1164,8 +1164,14 @@ void _glfwPlatformSetCursorPos(_GLFWwindow* window, double x, double y) } else { +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 + const NSRect localRect = NSMakeRect(x, contentRect.size.height - y - 1, 0, 0); + const NSRect globalRect = [window->ns.object convertRectToScreen:localRect]; + const NSPoint globalPoint = globalRect.origin; +#else const NSPoint localPoint = NSMakePoint(x, contentRect.size.height - y - 1); const NSPoint globalPoint = [window->ns.object convertBaseToScreen:localPoint]; +#endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/ CGWarpMouseCursorPosition(CGPointMake(globalPoint.x, transformY(globalPoint.y)));