mirror of
https://github.com/glfw/glfw.git
synced 2026-09-20 16:30:45 +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.
This commit is contained in:
committed by
Camilla Löwy
parent
03af6b3d4c
commit
a46f829de8
+6
-2
@@ -2556,7 +2556,8 @@ void _glfwSetCursorWayland(_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);
|
||||
@@ -2597,8 +2598,11 @@ void _glfwSetCursorWayland(_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