Wayland: Remove duplicate cursor state

The shared window struct already tracks the current cursor.
This commit is contained in:
Camilla Löwy 2026-01-30 14:00:55 +01:00
parent abb9db0d75
commit 232164f62b
2 changed files with 3 additions and 6 deletions

View File

@ -388,7 +388,6 @@ typedef struct _GLFWwindowWayland
struct libdecor_frame* frame; struct libdecor_frame* frame;
} libdecor; } libdecor;
_GLFWcursor* currentCursor;
double cursorPosX, cursorPosY; double cursorPosX, cursorPosY;
char* appId; char* appId;

View File

@ -1283,7 +1283,7 @@ static void incrementCursorImage(void)
if (window->wl.surface != _glfw.wl.pointerSurface) if (window->wl.surface != _glfw.wl.pointerSurface)
return; return;
_GLFWcursor* cursor = window->wl.currentCursor; _GLFWcursor* cursor = window->cursor;
if (cursor && cursor->wl.cursor) if (cursor && cursor->wl.cursor)
{ {
cursor->wl.currentImage += 1; cursor->wl.currentImage += 1;
@ -1543,7 +1543,7 @@ static void pointerHandleEnter(void* userData,
_GLFWwindow* window = wl_surface_get_user_data(surface); _GLFWwindow* window = wl_surface_get_user_data(surface);
if (window->wl.surface == surface) if (window->wl.surface == surface)
{ {
_glfwSetCursorWayland(window, window->wl.currentCursor); _glfwSetCursorWayland(window, window->cursor);
_glfwInputCursorEnter(window, GLFW_TRUE); _glfwInputCursorEnter(window, GLFW_TRUE);
if (window->cursorMode != GLFW_CURSOR_DISABLED) if (window->cursorMode != GLFW_CURSOR_DISABLED)
@ -2736,7 +2736,7 @@ void _glfwSetCursorPosWayland(_GLFWwindow* window, double x, double y)
void _glfwSetCursorModeWayland(_GLFWwindow* window, int mode) void _glfwSetCursorModeWayland(_GLFWwindow* window, int mode)
{ {
_glfwSetCursorWayland(window, window->wl.currentCursor); _glfwSetCursorWayland(window, window->cursor);
} }
const char* _glfwGetScancodeNameWayland(int scancode) const char* _glfwGetScancodeNameWayland(int scancode)
@ -3070,8 +3070,6 @@ void _glfwSetCursorWayland(_GLFWwindow* window, _GLFWcursor* cursor)
if (!_glfw.wl.pointer) if (!_glfw.wl.pointer)
return; return;
window->wl.currentCursor = cursor;
if (window->wl.surface != _glfw.wl.pointerSurface) if (window->wl.surface != _glfw.wl.pointerSurface)
return; return;