File: upstream_889ffed2_A11yKeyboardMonitor-Distinguish-modifier-and-other-key.patch

package info (click to toggle)
kwin 4%3A6.3.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 56,600 kB
  • sloc: cpp: 241,670; xml: 3,228; javascript: 2,214; ansic: 775; sh: 67; python: 15; makefile: 8
file content (45 lines) | stat: -rw-r--r-- 1,573 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From 889ffed2bbb40c44dbb8ef4268e5e0bbcb7671da Mon Sep 17 00:00:00 2001
From: Michael Weghorn <m.weghorn@posteo.de>
Date: Mon, 7 Jul 2025 13:09:38 +0200
Subject: [PATCH] A11yKeyboardMonitor: Distinguish modifier and other key

When processing a key event, only update
A11yKeyboardMonitor::lastModifier and
A11yKeyboardMonitor::lastModifierTime if
the pressed key is actually a modifier.

Otherwise, the "if the modifier was pressed twice within the
key repeat delay process it normally" logic above would
trigger when pressing a non-modifier key twice within
the key repeat delay time, breaking e.g. Orca's structural
navigation when pressing "H" twice to jump to the heading
after the next, and instead result in a literal "h" getting
inserted when input is accepted (e.g. in an editable
LibreOffice Writer document).

BUG: 506715
---
 src/a11ykeyboardmonitor.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/a11ykeyboardmonitor.cpp b/src/a11ykeyboardmonitor.cpp
index 3b7e5fa357a..5dad8add460 100644
--- a/src/a11ykeyboardmonitor.cpp
+++ b/src/a11ykeyboardmonitor.cpp
@@ -74,10 +74,10 @@ bool A11yKeyboardMonitor::processKey(uint32_t key, KeyboardKeyState state, std::
             return false;
         }
 
-        data.lastModifier = keysym;
-        data.lastModifierTime = time;
-
         if (data.modifiers.contains(keysym)) {
+            data.lastModifier = keysym;
+            data.lastModifierTime = time;
+
             if (released) {
                 data.pressedModifiers.remove(keysym);
             } else {
-- 
GitLab