From 65f1329635d15690258d1734fffbdb179483bbba Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 29 May 2022 14:50:34 +0530 Subject: [PATCH] Wayland: When the seat is closed remove any pending pointer animation and key repeat timers Fixes #5145 --- glfw/wl_init.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/glfw/wl_init.c b/glfw/wl_init.c index 5abaf2daf..eeddcf9f0 100644 --- a/glfw/wl_init.c +++ b/glfw/wl_init.c @@ -573,6 +573,10 @@ static void seatHandleCapabilities(void* data UNUSED, { wl_pointer_destroy(_glfw.wl.pointer); _glfw.wl.pointer = NULL; + if (_glfw.wl.cursorAnimationTimer) { + removeTimer(&_glfw.wl.eventLoopData, _glfw.wl.cursorAnimationTimer); + _glfw.wl.cursorAnimationTimer = 0; + } } if ((caps & WL_SEAT_CAPABILITY_KEYBOARD) && !_glfw.wl.keyboard) @@ -584,6 +588,11 @@ static void seatHandleCapabilities(void* data UNUSED, { wl_keyboard_destroy(_glfw.wl.keyboard); _glfw.wl.keyboard = NULL; + _glfw.wl.keyboardFocusId = 0; + if (_glfw.wl.keyRepeatInfo.keyRepeatTimer) { + removeTimer(&_glfw.wl.eventLoopData, _glfw.wl.keyRepeatInfo.keyRepeatTimer); + _glfw.wl.keyRepeatInfo.keyRepeatTimer = 0; + } } }