Skip to content

Commit

Permalink
When internal conversion happens, always bypass key release.
Browse files Browse the repository at this point in the history
Otherwise it may trigger wayland client side key repetition.

Fix #1028
  • Loading branch information
wengxt committed Apr 25, 2024
1 parent 6e665c9 commit 824a755
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/lib/fcitx/instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -974,6 +974,12 @@ Instance::Instance(int argc, char **argv) {
#ifdef ENABLE_KEYBOARD
if (keyEvent.forward()) {
FCITX_D();
// Always let the release key go through, since it shouldn't produce character.
// Otherwise it may wrongly trigger wayland client side repetition.
if (keyEvent.isRelease()) {
keyEvent.filter();
return;
}
auto *inputState = ic->propertyFor(&d->inputStateFactory_);
if (auto *xkbState = inputState->customXkbState()) {
if (auto utf32 = xkb_state_key_get_utf32(
Expand All @@ -989,10 +995,8 @@ Instance::Instance(int argc, char **argv) {
keyEvent.origKey().sym()) {
return;
}
if (!keyEvent.isRelease()) {
FCITX_KEYTRACE() << "Will commit char: " << utf32;
ic->commitString(utf8::UCS4ToUTF8(utf32));
}
FCITX_KEYTRACE() << "Will commit char: " << utf32;
ic->commitString(utf8::UCS4ToUTF8(utf32));
keyEvent.filterAndAccept();
} else if (!keyEvent.key().states().test(KeyState::Ctrl) &&
keyEvent.rawKey().sym() !=
Expand Down

0 comments on commit 824a755

Please sign in to comment.