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:
Camilla Löwy
2019-07-08 14:45:31 +02:00
committed by Camilla Löwy
parent 03af6b3d4c
commit a46f829de8
4 changed files with 120 additions and 43 deletions
+6 -2
View File
@@ -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,