Fix cursor behavior on OSX

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.
This commit is contained in:
Arseny Kapoulkine 2014-07-29 08:35:56 -07:00
parent c39ebfe1b8
commit ab1301de8a

View File

@ -197,8 +197,6 @@ static NSRect convertRectToBacking(_GLFWwindow* window, NSRect contentRect)
- (void)windowDidResignKey:(NSNotification *)notification - (void)windowDidResignKey:(NSNotification *)notification
{ {
_glfwInputWindowFocus(window, GL_FALSE); _glfwInputWindowFocus(window, GL_FALSE);
window->cursorMode = GLFW_CURSOR_NORMAL;
_glfwPlatformApplyCursorMode(window);
} }
@end @end
@ -675,14 +673,6 @@ static int translateKey(unsigned int key)
_glfwInputScroll(window, deltaX, deltaY); _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 <NSDraggingInfo>)sender - (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
{ {
if ((NSDragOperationGeneric & [sender draggingSourceOperationMask]) if ((NSDragOperationGeneric & [sender draggingSourceOperationMask])