Skip to content

Commit

Permalink
increase the delay to ms level.
Browse files Browse the repository at this point in the history
non-systemd event loop may not be able to handle high accuracy timer. So
increase to ms level to make it more reliable.
  • Loading branch information
wengxt committed Jun 25, 2024
1 parent a59d8fa commit 193f5b4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion im/pinyin/pinyin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2095,7 +2095,7 @@ void PinyinEngine::keyEvent(const InputMethodEntry &entry, KeyEvent &event) {
if (!puncStr.empty()) {
// forward the original key is the best choice.
state->cancelLastEvent_ = instance()->eventLoop().addTimeEvent(
CLOCK_MONOTONIC, now(CLOCK_MONOTONIC) + 300, 1,
CLOCK_MONOTONIC, now(CLOCK_MONOTONIC) + 3000, 1,
[this, ref = inputContext->watch(),
puncStr = puncStr](EventSourceTime *, uint64_t) {
if (auto *inputContext = ref.get()) {
Expand Down
2 changes: 1 addition & 1 deletion im/table/state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,7 @@ void TableState::keyEvent(const InputMethodEntry &entry, KeyEvent &event) {
// forward the original key is the best choice.
cancelLastEvent_ =
engine_->instance()->eventLoop().addTimeEvent(
CLOCK_MONOTONIC, now(CLOCK_MONOTONIC) + 300, 1,
CLOCK_MONOTONIC, now(CLOCK_MONOTONIC) + 3000, 1,
[this, ref = inputContext->watch(),
puncStr = puncStr](EventSourceTime *, uint64_t) {
if (auto *inputContext = ref.get()) {
Expand Down

0 comments on commit 193f5b4

Please sign in to comment.