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