From 232164f62b0edbf667cba37c91bab92ffbb020d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Fri, 30 Jan 2026 14:00:55 +0100 Subject: [PATCH] Wayland: Remove duplicate cursor state The shared window struct already tracks the current cursor. --- src/wl_platform.h | 1 - src/wl_window.c | 8 +++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/wl_platform.h b/src/wl_platform.h index 560d0b0c..c2ddb732 100644 --- a/src/wl_platform.h +++ b/src/wl_platform.h @@ -388,7 +388,6 @@ typedef struct _GLFWwindowWayland struct libdecor_frame* frame; } libdecor; - _GLFWcursor* currentCursor; double cursorPosX, cursorPosY; char* appId; diff --git a/src/wl_window.c b/src/wl_window.c index ee8e4a61..b00b8ced 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -1283,7 +1283,7 @@ static void incrementCursorImage(void) if (window->wl.surface != _glfw.wl.pointerSurface) return; - _GLFWcursor* cursor = window->wl.currentCursor; + _GLFWcursor* cursor = window->cursor; if (cursor && cursor->wl.cursor) { cursor->wl.currentImage += 1; @@ -1543,7 +1543,7 @@ static void pointerHandleEnter(void* userData, _GLFWwindow* window = wl_surface_get_user_data(surface); if (window->wl.surface == surface) { - _glfwSetCursorWayland(window, window->wl.currentCursor); + _glfwSetCursorWayland(window, window->cursor); _glfwInputCursorEnter(window, GLFW_TRUE); if (window->cursorMode != GLFW_CURSOR_DISABLED) @@ -2736,7 +2736,7 @@ void _glfwSetCursorPosWayland(_GLFWwindow* window, double x, double y) void _glfwSetCursorModeWayland(_GLFWwindow* window, int mode) { - _glfwSetCursorWayland(window, window->wl.currentCursor); + _glfwSetCursorWayland(window, window->cursor); } const char* _glfwGetScancodeNameWayland(int scancode) @@ -3070,8 +3070,6 @@ void _glfwSetCursorWayland(_GLFWwindow* window, _GLFWcursor* cursor) if (!_glfw.wl.pointer) return; - window->wl.currentCursor = cursor; - if (window->wl.surface != _glfw.wl.pointerSurface) return;