mirror of
https://github.com/glfw/glfw.git
synced 2024-11-26 20:11:58 +00:00
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.
This commit is contained in:
parent
26f86ac50a
commit
e74ebf0be3
@ -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])
|
||||||
|
Loading…
Reference in New Issue
Block a user