-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfix_waylandimserverv2_bug.patch
More file actions
44 lines (39 loc) · 1.92 KB
/
fix_waylandimserverv2_bug.patch
File metadata and controls
44 lines (39 loc) · 1.92 KB
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
From db24ee744d19a4a50a1b323cf246c09d769c6c72 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9C=BD=E6=9C=BD=E6=9C=BD=E6=9C=BD=E6=9C=BD?=
<694253220@qq.com>
Date: Thu, 18 Sep 2025 11:52:13 +0800
Subject: [PATCH] fix WaylandIMInputContextV2's capslock bug and fix preedit
bug in electron
---
src/frontend/waylandim/waylandimserverv2.cpp | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/frontend/waylandim/waylandimserverv2.cpp b/src/frontend/waylandim/waylandimserverv2.cpp
index 4aeb73f4..51317b5b 100644
--- a/src/frontend/waylandim/waylandimserverv2.cpp
+++ b/src/frontend/waylandim/waylandimserverv2.cpp
@@ -538,10 +538,12 @@ void WaylandIMInputContextV2::modifiersCallback(uint32_t /*serial*/,
mods_locked, 0, 0, group);
server_->instance()->updateXkbStateMask(
server_->group()->display(), mods_depressed, mods_latched, mods_locked);
- mask = xkb_state_serialize_mods(
- server_->state_.get(),
- static_cast<xkb_state_component>(XKB_STATE_MODS_DEPRESSED |
- XKB_STATE_MODS_LATCHED));
+ // mask = xkb_state_serialize_mods(
+ // server_->state_.get(),
+ // static_cast<xkb_state_component>(XKB_STATE_MODS_DEPRESSED |
+ // XKB_STATE_MODS_LATCHED));
+ mask = xkb_state_serialize_mods(server_->state_.get(),
+ XKB_STATE_MODS_EFFECTIVE);
server_->modifiers_ = 0;
if (mask & server_->stateMask_.shift_mask) {
@@ -665,7 +667,7 @@ void WaylandIMInputContextV2::updatePreeditDelegate(InputContext *ic) const {
}
// Validate not empty and within wayland limit.
- if (preedit.textLength() > 0 &&
+ if (preedit.textLength() >= 0 &&
preedit.textLength() < WaylandIMServerBase::safeStringLimit) {
if (cursorStart < 0) {
cursorStart = cursorEnd = preedit.textLength();
--
2.51.0