Wayland: Move fallback decoration struct member

The cursorPreviousName member was only used for the fallback decorations
but was not grouped with other related members.
This commit is contained in:
Camilla Löwy 2025-07-18 15:43:32 +02:00
parent ddbb8e0f2c
commit 5190a30d8a
2 changed files with 6 additions and 5 deletions

View File

@ -414,6 +414,7 @@ typedef struct _GLFWwindowWayland
_GLFWfallbackEdgeWayland top, left, right, bottom; _GLFWfallbackEdgeWayland top, left, right, bottom;
struct wl_surface* focus; struct wl_surface* focus;
wl_fixed_t pointerX, pointerY; wl_fixed_t pointerX, pointerY;
const char* cursorName;
} fallback; } fallback;
} _GLFWwindowWayland; } _GLFWwindowWayland;
@ -455,7 +456,6 @@ typedef struct _GLFWlibraryWayland
struct wl_cursor_theme* cursorTheme; struct wl_cursor_theme* cursorTheme;
struct wl_cursor_theme* cursorThemeHiDPI; struct wl_cursor_theme* cursorThemeHiDPI;
struct wl_surface* cursorSurface; struct wl_surface* cursorSurface;
const char* cursorPreviousName;
int cursorTimerfd; int cursorTimerfd;
uint32_t serial; uint32_t serial;
uint32_t pointerEnterSerial; uint32_t pointerEnterSerial;

View File

@ -1417,7 +1417,6 @@ static void pointerHandleLeave(void* userData,
_glfw.wl.serial = serial; _glfw.wl.serial = serial;
_glfw.wl.pointerFocus = NULL; _glfw.wl.pointerFocus = NULL;
_glfw.wl.cursorPreviousName = NULL;
if (window->wl.hovered) if (window->wl.hovered)
{ {
@ -1427,7 +1426,10 @@ static void pointerHandleLeave(void* userData,
else else
{ {
if (window->wl.fallback.decorations) if (window->wl.fallback.decorations)
{
window->wl.fallback.focus = NULL; 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.cursorPosX = xpos;
window->wl.cursorPosY = ypos; window->wl.cursorPosY = ypos;
_glfw.wl.cursorPreviousName = NULL;
_glfwInputCursorPos(window, xpos, ypos); _glfwInputCursorPos(window, xpos, ypos);
return; 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_surface* surface = _glfw.wl.cursorSurface;
struct wl_cursor_theme* theme = _glfw.wl.cursorTheme; 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_damage(surface, 0, 0, image->width, image->height);
wl_surface_commit(surface); wl_surface_commit(surface);
_glfw.wl.cursorPreviousName = cursorName; window->wl.fallback.cursorName = cursorName;
} }
} }
} }