From e74ebf0be3c079b94afd95d051284e6bb5ca8053 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Tue, 29 Jul 2014 08:35:56 -0700 Subject: [PATCH] Fix cursor behavior on OS X. Don't implement resetCursorRects: this occasionally hides the cursor since an empty cursor is assigned to the window rectangle. Implementing this method is not required since OS displays the window cursor correctly by default. Don't reset cursor mode when window loses focus: once again, OS handles this correctly, and this means that the window cursor state is restored when window gains focus again. --- src/cocoa_window.m | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/cocoa_window.m b/src/cocoa_window.m index 0eff37ac..ceac4d98 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -197,8 +197,6 @@ static NSRect convertRectToBacking(_GLFWwindow* window, NSRect contentRect) - (void)windowDidResignKey:(NSNotification *)notification { _glfwInputWindowFocus(window, GL_FALSE); - window->cursorMode = GLFW_CURSOR_NORMAL; - _glfwPlatformApplyCursorMode(window); } @end @@ -675,14 +673,6 @@ static int translateKey(unsigned int key) _glfwInputScroll(window, deltaX, deltaY); } -- (void)resetCursorRects -{ - // This makes the cursor dissapear when the window is - // resized or received a drag operation - [self discardCursorRects]; - [self addCursorRect:[self bounds] cursor:_glfw.ns.cursor]; -} - - (NSDragOperation)draggingEntered:(id )sender { if ((NSDragOperationGeneric & [sender draggingSourceOperationMask])