mirror of
https://github.com/glfw/glfw.git
synced 2026-09-21 00:30:57 +00:00
Refactor cursor mode paths
This is the refactoring part of adding GLFW_CURSOR_CAPTURED, separated
out to help keep 3.3-stable similar to the main branch.
Related to #58.
(cherry picked from commit a46f829de8)
This commit is contained in:
+6
-2
@@ -2527,7 +2527,8 @@ void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor)
|
||||
if (!window->wl.lockedPointer)
|
||||
lockPointer(window);
|
||||
}
|
||||
else
|
||||
else if (window->cursorMode == GLFW_CURSOR_NORMAL ||
|
||||
window->cursorMode == GLFW_CURSOR_HIDDEN)
|
||||
{
|
||||
if (window->wl.lockedPointer)
|
||||
unlockPointer(window);
|
||||
@@ -2568,8 +2569,11 @@ void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor)
|
||||
setCursorImage(window, &cursorWayland);
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (window->cursorMode == GLFW_CURSOR_HIDDEN ||
|
||||
window->cursorMode == GLFW_CURSOR_DISABLED)
|
||||
{
|
||||
wl_pointer_set_cursor(_glfw.wl.pointer, _glfw.wl.pointerEnterSerial, NULL, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static void dataSourceHandleTarget(void* userData,
|
||||
|
||||
Reference in New Issue
Block a user