mirror of
https://github.com/glfw/glfw.git
synced 2024-11-29 21:37:27 +00:00
Cocoa: Fix unresponsive cursor after ungrab
There is a suppression interval (0.25 seconds by default) after a call
to CGWarpMouseCursorPosition, during which local hardware events
(keyboard and mouse) are ignored. GLFW already calls
CGEventSourceSetLocalEventsSuppressionInterval with a value of 0.0, but
it doesn't help in this case, there is still a short delay before the
cursor can be moved. Moving the CGAssociateMouseAndMouseCursorPosition
call after the cursor position has been restored, fixes the issue.
Closes #1962
(cherry picked from commit 157ebb80aa
)
This commit is contained in:
parent
6bb5f5d59d
commit
c32fefc6a0
@ -114,10 +114,10 @@ static void updateCursorMode(_GLFWwindow* window)
|
|||||||
else if (_glfw.ns.disabledCursorWindow == window)
|
else if (_glfw.ns.disabledCursorWindow == window)
|
||||||
{
|
{
|
||||||
_glfw.ns.disabledCursorWindow = NULL;
|
_glfw.ns.disabledCursorWindow = NULL;
|
||||||
CGAssociateMouseAndMouseCursorPosition(true);
|
|
||||||
_glfwPlatformSetCursorPos(window,
|
_glfwPlatformSetCursorPos(window,
|
||||||
_glfw.ns.restoreCursorPosX,
|
_glfw.ns.restoreCursorPosX,
|
||||||
_glfw.ns.restoreCursorPosY);
|
_glfw.ns.restoreCursorPosY);
|
||||||
|
CGAssociateMouseAndMouseCursorPosition(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cursorInContentArea(window))
|
if (cursorInContentArea(window))
|
||||||
|
Loading…
Reference in New Issue
Block a user