mirror of
https://github.com/glfw/glfw.git
synced 2025-10-02 21:00:57 +00:00
Merge 3e1b931033
into 0e7c6e1d82
This commit is contained in:
commit
ae9de33bb6
@ -60,6 +60,8 @@ static void enterFullscreenMode(_GLFWwindow* window)
|
||||
|
||||
[window->ns.view enterFullScreenMode:window->monitor->ns.screen
|
||||
withOptions:nil];
|
||||
|
||||
_glfwInputWindowFocus(window, GL_TRUE);
|
||||
}
|
||||
|
||||
// Leave fullscreen mode
|
||||
@ -1056,6 +1058,10 @@ void _glfwPlatformSetCursorPos(_GLFWwindow* window, double x, double y)
|
||||
CGDisplayMoveCursorToPoint(window->monitor->ns.displayID,
|
||||
CGPointMake(x, y));
|
||||
}
|
||||
else if ([window->ns.view isInFullScreenMode])
|
||||
{
|
||||
CGWarpMouseCursorPosition(CGPointMake(x, y));
|
||||
}
|
||||
else
|
||||
{
|
||||
const NSRect contentRect = [window->ns.view frame];
|
||||
@ -1065,6 +1071,12 @@ void _glfwPlatformSetCursorPos(_GLFWwindow* window, double x, double y)
|
||||
CGWarpMouseCursorPosition(CGPointMake(globalPoint.x,
|
||||
transformY(globalPoint.y)));
|
||||
}
|
||||
|
||||
if (window->cursorMode != GLFW_CURSOR_DISABLED)
|
||||
{
|
||||
CGAssociateMouseAndMouseCursorPosition(true);
|
||||
}
|
||||
setModeCursor(window, window->cursorMode);
|
||||
}
|
||||
|
||||
void _glfwPlatformSetCursorMode(_GLFWwindow* window, int mode)
|
||||
|
@ -48,6 +48,8 @@ static void setCursorMode(_GLFWwindow* window, int newMode)
|
||||
oldMode = window->cursorMode;
|
||||
if (oldMode == newMode)
|
||||
return;
|
||||
|
||||
window->cursorMode = newMode;
|
||||
|
||||
if (window == _glfw.focusedWindow)
|
||||
{
|
||||
@ -72,7 +74,6 @@ static void setCursorMode(_GLFWwindow* window, int newMode)
|
||||
_glfwPlatformSetCursorMode(window, newMode);
|
||||
}
|
||||
|
||||
window->cursorMode = newMode;
|
||||
}
|
||||
|
||||
// Set sticky keys mode for the specified window
|
||||
|
Loading…
Reference in New Issue
Block a user