Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repeated key in st #33

Closed
pickfire opened this issue Jan 12, 2020 · 13 comments
Closed

Repeated key in st #33

pickfire opened this issue Jan 12, 2020 · 13 comments

Comments

@pickfire
Copy link

pickfire commented Jan 12, 2020

On some applications such as st, fcitx5 have weird behavior such that there feels like some keys are slow to appear (on us-dvorak) when holding the keys for a short while, the problem does not appear on fcitx.

Holding the keys in fcitx5 shuangpin input and mozc japanese input causes fcitx to kimpanel to hang (or crash) and I need to xkill st. Not sure if this is a bug in st or fcitx5 since it works with fcitx.

For example, hold j for a while and then press k when stop holding the key, the old keys will still be inserted. Maybe because I have a high keyboard typematic rate, xset r rate 150 60?

@wengxt
Copy link
Member

wengxt commented Jan 12, 2020

it's irrelevant IMHO. I think the cause is same as #30.

@wengxt
Copy link
Member

wengxt commented Jan 12, 2020

Should be improved after 75d5cbd .

@wengxt wengxt closed this as completed Jan 12, 2020
@wengxt
Copy link
Member

wengxt commented Jan 12, 2020

Actually I just noticed that st use a very small buffer for key string, so it will not commit string longer than 32 bytes from im. Probably you should report this to st upstream (looking for the caller of XmbLookupString). Comparing to xterm, xterm uses 500 bytes as the buffer, which should be practical for any common usage.

@pickfire
Copy link
Author

pickfire commented Jan 14, 2020

The issue still persists even in the latest commit. r435.8d889da-1 guess maybe I should go and check on the st side. Changing the buffer size for XmbLookupString to 500 does not seem to fix it either.

@pickfire
Copy link
Author

pickfire commented Jan 18, 2020

In the meantime, I increased the buffer from 32 to 64 to take in middle to long string from IME, so it should even work for sentences now, the patch was included in upstream https://git.suckless.org/st/commit/895e5b50a8cc835c19a45e1e328eb4dc78f5fd0c.html.

@wengxt
Copy link
Member

wengxt commented Jan 28, 2020

Tried multiple different xim based application (gtk-xim, xterm) non of them have the same problem. So I don't think the issue is in fcitx. I suspect st misses some XFlush call.

@pickfire
Copy link
Author

But I tried using old fcitx and it works fine, okay I will check on the XFlush call.

@pickfire
Copy link
Author

I believe it probably have something to do with high autorepeat I did with xset r rate 150 60, when I did not set that, it works nicely.

@wengxt
Copy link
Member

wengxt commented Jan 30, 2020 via email

@pickfire
Copy link
Author

pickfire commented Feb 2, 2020

Ah, I believed I spot the issue in st, it was introduced in https://git.suckless.org/st/commit/e85b6b64660214121164ea97fb098eaa4935f7db.html#h0-0-3 where xximspot to update the cursor for XIM is called in every draw.

@pickfire
Copy link
Author

pickfire commented Feb 2, 2020

Weird that XNPreeditStartCallback is not called on fcitx, but ibus is able to recognize that. Should i not use XIMPreeditCallbacks?

@wengxt
Copy link
Member

wengxt commented Feb 2, 2020 via email

@pickfire
Copy link
Author

pickfire commented Feb 3, 2020

Okay, thanks a lot for the input. st is also using over-the-spot for now. I also found a patch to fix the repeated key issue, looks like this is an issue with st, not fcitx5 but just that it doesn't happen in fcitx.

wengxt added a commit that referenced this issue Mar 16, 2020
Once too much event comes in to main thread and main thread is not fast
enough to handle the event, the XIM client may hang in such case.
Fix #33.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants