mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 13:04:35 +00:00
Cocoa: Fix unresponsive cursor after cursor warp
This is a companion to157ebb80aa
and fixes the same issue for calls to glfwSetCursorPos. Related to #1962 (cherry picked from commit6ed5294223
)
This commit is contained in:
parent
c32fefc6a0
commit
95df61e5ed
@ -126,6 +126,8 @@ information on what to include when reporting a bug.
|
|||||||
- [Win32] Bugfix: Compilation with LLVM for Windows failed (#1807,#1824,#1874)
|
- [Win32] Bugfix: Compilation with LLVM for Windows failed (#1807,#1824,#1874)
|
||||||
- [Cocoa] Bugfix: The MoltenVK layer contents scale was updated only after
|
- [Cocoa] Bugfix: The MoltenVK layer contents scale was updated only after
|
||||||
related events were emitted
|
related events were emitted
|
||||||
|
- [Cocoa] Bugfix: Moving the cursor programmatically would freeze it for
|
||||||
|
a fraction of a second (#1962)
|
||||||
- [X11] Bugfix: Changing `GLFW_FLOATING` could leak memory
|
- [X11] Bugfix: Changing `GLFW_FLOATING` could leak memory
|
||||||
- [Wayland] Bugfix: Some keys were not repeating in Wayland (#1908)
|
- [Wayland] Bugfix: Some keys were not repeating in Wayland (#1908)
|
||||||
- [Wayland] Bugfix: Non-arrow cursors are offset from the hotspot (#1706,#1899)
|
- [Wayland] Bugfix: Non-arrow cursors are offset from the hotspot (#1706,#1899)
|
||||||
|
@ -117,7 +117,8 @@ static void updateCursorMode(_GLFWwindow* window)
|
|||||||
_glfwPlatformSetCursorPos(window,
|
_glfwPlatformSetCursorPos(window,
|
||||||
_glfw.ns.restoreCursorPosX,
|
_glfw.ns.restoreCursorPosX,
|
||||||
_glfw.ns.restoreCursorPosY);
|
_glfw.ns.restoreCursorPosY);
|
||||||
CGAssociateMouseAndMouseCursorPosition(true);
|
// NOTE: The matching CGAssociateMouseAndMouseCursorPosition call is
|
||||||
|
// made in _glfwPlatformSetCursorPos as part of a workaround
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cursorInContentArea(window))
|
if (cursorInContentArea(window))
|
||||||
@ -1523,6 +1524,11 @@ void _glfwPlatformSetCursorPos(_GLFWwindow* window, double x, double y)
|
|||||||
_glfwTransformYNS(globalPoint.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
|
} // autoreleasepool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user