From 0339d5985113b02afb6dafa061055f2ea30d7bff Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 4 Mar 2025 06:03:42 +0530 Subject: [PATCH] Wayland: Fix mouse pointer position update not being sent when focus regained GLFW Wayland backend was not sending a cursor position input event on mouse entering the window surface. Fixes #8397 --- docs/changelog.rst | 2 ++ glfw/wl_init.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index d2ad2af6a..7bd3a3023 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -141,6 +141,8 @@ Detailed list of changes - macOS: notify kitten: Fix waiting for result from desktop notification not working (:disc:`8379`) +- Wayland: Fix mouse pointer position update not being sent when focus regained (:iss`8397`) + 0.39.1 [2025-02-01] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/glfw/wl_init.c b/glfw/wl_init.c index 8e134db57..6fabe4099 100644 --- a/glfw/wl_init.c +++ b/glfw/wl_init.c @@ -94,9 +94,11 @@ pointerHandleEnter( window->wl.hovered = true; window->wl.cursorPosX = x; window->wl.cursorPosY = y; - _glfwPlatformSetCursor(window, window->wl.currentCursor); _glfwInputCursorEnter(window, true); + // Ensure kitty updates the mouse position, see https://github.com/kovidgoyal/kitty/issues/8397 + _glfwInputCursorPos(window, x, y); + _glfw.wl.cursorPreviousShape = GLFW_INVALID_CURSOR; } }