blob: 85fde89585fd8c6aa452452ebfa26d4349739e02 [file] [log] [blame]
Skyler Grey3de6ec92022-08-26 08:01:08 +01001From 646bdbd0022d01915ffe2fcbca73b026b835df87 Mon Sep 17 00:00:00 2001
2From: Kovid Goyal <kovid@kovidgoyal.net>
3Date: Fri, 10 Jun 2022 21:38:30 +0530
4Subject: [PATCH] Wayland: Fix a regression in the previous release that caused
5 mouse cursor animation and keyboard repeat to stop working when switching
6 seats
7
8Fixes #5188
9---
10 docs/changelog.rst | 3 +++
11 glfw/wl_init.c | 10 ++--------
12 2 files changed, 5 insertions(+), 8 deletions(-)
13
14diff --git a/docs/changelog.rst b/docs/changelog.rst
15index afdf4ecfa4..9d253f5227 100644
16--- a/docs/changelog.rst
17+++ b/docs/changelog.rst
18@@ -40,6 +40,9 @@ Detailed list of changes
19
20 - Reduce startup latency by ~50 milliseconds when running kittens via key-bindings or remote control (:iss:`5159`)
21
22+- Wayland: Fix a regression in the previous release that caused mouse cursor
23+ animation and keyboard repeat to stop working when switching seats (:iss:`5188`)
24+
25
26 0.25.2 [2022-06-07]
27 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
28diff --git a/glfw/wl_init.c b/glfw/wl_init.c
29index eeddcf9f0b..383ed86e10 100644
30--- a/glfw/wl_init.c
31+++ b/glfw/wl_init.c
32@@ -573,10 +573,7 @@ static void seatHandleCapabilities(void* data UNUSED,
33 {
34 wl_pointer_destroy(_glfw.wl.pointer);
35 _glfw.wl.pointer = NULL;
36- if (_glfw.wl.cursorAnimationTimer) {
37- removeTimer(&_glfw.wl.eventLoopData, _glfw.wl.cursorAnimationTimer);
38- _glfw.wl.cursorAnimationTimer = 0;
39- }
40+ if (_glfw.wl.cursorAnimationTimer) toggleTimer(&_glfw.wl.eventLoopData, _glfw.wl.cursorAnimationTimer, 0);
41 }
42
43 if ((caps & WL_SEAT_CAPABILITY_KEYBOARD) && !_glfw.wl.keyboard)
44@@ -589,10 +586,7 @@ static void seatHandleCapabilities(void* data UNUSED,
45 wl_keyboard_destroy(_glfw.wl.keyboard);
46 _glfw.wl.keyboard = NULL;
47 _glfw.wl.keyboardFocusId = 0;
48- if (_glfw.wl.keyRepeatInfo.keyRepeatTimer) {
49- removeTimer(&_glfw.wl.eventLoopData, _glfw.wl.keyRepeatInfo.keyRepeatTimer);
50- _glfw.wl.keyRepeatInfo.keyRepeatTimer = 0;
51- }
52+ if (_glfw.wl.keyRepeatInfo.keyRepeatTimer) toggleTimer(&_glfw.wl.eventLoopData, _glfw.wl.keyRepeatInfo.keyRepeatTimer, 0);
53 }
54 }
55