From 5190a30d8a96d76de172cb6595e4fd658ca8ada1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Fri, 18 Jul 2025 15:43:32 +0200 Subject: [PATCH] Wayland: Move fallback decoration struct member The cursorPreviousName member was only used for the fallback decorations but was not grouped with other related members. --- src/wl_platform.h | 2 +- src/wl_window.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/wl_platform.h b/src/wl_platform.h index a85a7c2a..c3e45693 100644 --- a/src/wl_platform.h +++ b/src/wl_platform.h @@ -414,6 +414,7 @@ typedef struct _GLFWwindowWayland _GLFWfallbackEdgeWayland top, left, right, bottom; struct wl_surface* focus; wl_fixed_t pointerX, pointerY; + const char* cursorName; } fallback; } _GLFWwindowWayland; @@ -455,7 +456,6 @@ typedef struct _GLFWlibraryWayland struct wl_cursor_theme* cursorTheme; struct wl_cursor_theme* cursorThemeHiDPI; struct wl_surface* cursorSurface; - const char* cursorPreviousName; int cursorTimerfd; uint32_t serial; uint32_t pointerEnterSerial; diff --git a/src/wl_window.c b/src/wl_window.c index 677efd79..b8a3e716 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -1417,7 +1417,6 @@ static void pointerHandleLeave(void* userData, _glfw.wl.serial = serial; _glfw.wl.pointerFocus = NULL; - _glfw.wl.cursorPreviousName = NULL; if (window->wl.hovered) { @@ -1427,7 +1426,10 @@ static void pointerHandleLeave(void* userData, else { if (window->wl.fallback.decorations) + { window->wl.fallback.focus = NULL; + window->wl.fallback.cursorName = NULL; + } } } @@ -1451,7 +1453,6 @@ static void pointerHandleMotion(void* userData, { window->wl.cursorPosX = xpos; window->wl.cursorPosY = ypos; - _glfw.wl.cursorPreviousName = NULL; _glfwInputCursorPos(window, xpos, ypos); return; } @@ -1495,7 +1496,7 @@ static void pointerHandleMotion(void* userData, } } - if (_glfw.wl.cursorPreviousName != cursorName) + if (window->wl.fallback.cursorName != cursorName) { struct wl_surface* surface = _glfw.wl.cursorSurface; struct wl_cursor_theme* theme = _glfw.wl.cursorTheme; @@ -1531,7 +1532,7 @@ static void pointerHandleMotion(void* userData, wl_surface_damage(surface, 0, 0, image->width, image->height); wl_surface_commit(surface); - _glfw.wl.cursorPreviousName = cursorName; + window->wl.fallback.cursorName = cursorName; } } }