mirror of
https://github.com/glfw/glfw.git
synced 2024-12-01 22:37:12 +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
|
- (void)resetCursorRects
|
||||||
{
|
{
|
||||||
|
[self discardCursorRects];
|
||||||
[self addCursorRect:[self bounds] cursor:_glfw.ns.cursor];
|
[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 setContentView:window->ns.view];
|
||||||
[window->ns.object setDelegate:window->ns.delegate];
|
[window->ns.object setDelegate:window->ns.delegate];
|
||||||
[window->ns.object setAcceptsMouseMovedEvents:YES];
|
[window->ns.object setAcceptsMouseMovedEvents:YES];
|
||||||
|
[window->ns.object disableCursorRects];
|
||||||
[window->ns.object center];
|
[window->ns.object center];
|
||||||
|
|
||||||
if ([window->ns.object respondsToSelector:@selector(setRestorable:)])
|
if ([window->ns.object respondsToSelector:@selector(setRestorable:)])
|
||||||
@ -949,12 +951,15 @@ void _glfwPlatformSetCursorMode(_GLFWwindow* window, int mode)
|
|||||||
{
|
{
|
||||||
case GLFW_CURSOR_NORMAL:
|
case GLFW_CURSOR_NORMAL:
|
||||||
[window->ns.object disableCursorRects];
|
[window->ns.object disableCursorRects];
|
||||||
|
[window->ns.object invalidateCursorRectsForView:window->ns.view];
|
||||||
break;
|
break;
|
||||||
case GLFW_CURSOR_HIDDEN:
|
case GLFW_CURSOR_HIDDEN:
|
||||||
[window->ns.object enableCursorRects];
|
[window->ns.object enableCursorRects];
|
||||||
|
[window->ns.object invalidateCursorRectsForView:window->ns.view];
|
||||||
break;
|
break;
|
||||||
case GLFW_CURSOR_CAPTURED:
|
case GLFW_CURSOR_CAPTURED:
|
||||||
[window->ns.object enableCursorRects];
|
[window->ns.object enableCursorRects];
|
||||||
|
[window->ns.object invalidateCursorRectsForView:window->ns.view];
|
||||||
CGAssociateMouseAndMouseCursorPosition(false);
|
CGAssociateMouseAndMouseCursorPosition(false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user