mirror of
https://github.com/glfw/glfw.git
synced 2024-11-26 14:24:35 +00:00
Fixed hidden cursor mode on OS X.
This commit is contained in:
parent
a2745574c8
commit
2891c9629f
@ -511,6 +511,7 @@ static int convertMacKeyCode(unsigned int macKeyCode)
|
||||
|
||||
- (void)resetCursorRects
|
||||
{
|
||||
[self discardCursorRects];
|
||||
[self addCursorRect:[self bounds] cursor:_glfw.ns.cursor];
|
||||
}
|
||||
|
||||
@ -726,6 +727,7 @@ static GLboolean createWindow(_GLFWwindow* window,
|
||||
[window->ns.object setContentView:window->ns.view];
|
||||
[window->ns.object setDelegate:window->ns.delegate];
|
||||
[window->ns.object setAcceptsMouseMovedEvents:YES];
|
||||
[window->ns.object disableCursorRects];
|
||||
[window->ns.object center];
|
||||
|
||||
if ([window->ns.object respondsToSelector:@selector(setRestorable:)])
|
||||
@ -949,12 +951,15 @@ void _glfwPlatformSetCursorMode(_GLFWwindow* window, int mode)
|
||||
{
|
||||
case GLFW_CURSOR_NORMAL:
|
||||
[window->ns.object disableCursorRects];
|
||||
[window->ns.object invalidateCursorRectsForView:window->ns.view];
|
||||
break;
|
||||
case GLFW_CURSOR_HIDDEN:
|
||||
[window->ns.object enableCursorRects];
|
||||
[window->ns.object invalidateCursorRectsForView:window->ns.view];
|
||||
break;
|
||||
case GLFW_CURSOR_CAPTURED:
|
||||
[window->ns.object enableCursorRects];
|
||||
[window->ns.object invalidateCursorRectsForView:window->ns.view];
|
||||
CGAssociateMouseAndMouseCursorPosition(false);
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user