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

CJK Input delay so much #311

Closed
xland opened this issue May 14, 2022 · 3 comments
Closed

CJK Input delay so much #311

xland opened this issue May 14, 2022 · 3 comments
Labels
backends Platforms and renderers internationalization performance Performance suggestions or specific issues

Comments

@xland
Copy link

xland commented May 14, 2022

I record a video to show this issue.
Does WM_KEYDOWN or WM_CHAR message processor do too much work?
It seems that the video should be downloaded to play.

RmlUiInputIssue.mp4
@mikke89
Copy link
Owner

mikke89 commented May 15, 2022

Thanks for reporting. I think I may have found the culprit.

I haven't had any experience with IME overlays previously, but I tried to install a CJK keyboard for testing, and yes I can confirm that the input is very slow.

I tested this on the backends branch so we can easily switch backends, there I found that everything is smooth on the GLFW backend, and slow on the Win32 backend. As an aside, I didn't get any input on the SDL backend, not sure what's going on there but I'll take a closer look. In any case, this pointed to the Win32 backend as the culprit.

Eventually I found that PeekMessage was called at most once a frame, replacing this with a while-loop seems to solve the issue for me. I'm guessing there are more Windows messages generated with CJK input, and because the messages were tied to the frame rate the input becomes very slow.

Can you test the change I made in the backends branch?

@mikke89 mikke89 added internationalization backends Platforms and renderers performance Performance suggestions or specific issues labels May 15, 2022
@xland
Copy link
Author

xland commented May 16, 2022

I've tested it.
It's great.
No delay any more.

@mikke89
Copy link
Owner

mikke89 commented May 16, 2022

That's good to hear!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backends Platforms and renderers internationalization performance Performance suggestions or specific issues
Projects
None yet
Development

No branches or pull requests

2 participants