mirror of
https://github.com/glfw/glfw.git
synced 2024-11-10 00:51:47 +00:00
Cocoa: Fix unresponsive cursor after cursor warp
This is a companion to 157ebb80aa
and
fixes the same issue for calls to glfwSetCursorPos.
Related to #1962
This commit is contained in:
parent
157ebb80aa
commit
6ed5294223
@ -206,6 +206,8 @@ information on what to include when reporting a bug.
|
||||
- [Cocoa] Bugfix: The install name of the installed dylib was relative (#1504)
|
||||
- [Cocoa] Bugfix: The MoltenVK layer contents scale was updated only after
|
||||
related events were emitted
|
||||
- [Cocoa] Bugfix: Moving the cursor programmatically would freeze it for
|
||||
a fraction of a second (#1962)
|
||||
- [X11] Bugfix: The CMake files did not check for the XInput headers (#1480)
|
||||
- [X11] Bugfix: Key names were not updated when the keyboard layout changed
|
||||
(#1462,#1528)
|
||||
|
@ -117,7 +117,8 @@ static void updateCursorMode(_GLFWwindow* window)
|
||||
_glfwPlatformSetCursorPos(window,
|
||||
_glfw.ns.restoreCursorPosX,
|
||||
_glfw.ns.restoreCursorPosY);
|
||||
CGAssociateMouseAndMouseCursorPosition(true);
|
||||
// NOTE: The matching CGAssociateMouseAndMouseCursorPosition call is
|
||||
// made in _glfwPlatformSetCursorPos as part of a workaround
|
||||
}
|
||||
|
||||
if (cursorInContentArea(window))
|
||||
@ -1518,6 +1519,11 @@ void _glfwPlatformSetCursorPos(_GLFWwindow* window, double x, double y)
|
||||
_glfwTransformYNS(globalPoint.y)));
|
||||
}
|
||||
|
||||
// HACK: Calling this right after setting the cursor position prevents macOS
|
||||
// from freezing the cursor for a fraction of a second afterwards
|
||||
if (window->cursorMode != GLFW_CURSOR_DISABLED)
|
||||
CGAssociateMouseAndMouseCursorPosition(true);
|
||||
|
||||
} // autoreleasepool
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user