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

IME on Windows does not work with multi-threading #3123

Closed
fredizzimo opened this issue Sep 30, 2023 · 3 comments · Fixed by #3168
Closed

IME on Windows does not work with multi-threading #3123

fredizzimo opened this issue Sep 30, 2023 · 3 comments · Fixed by #3168

Comments

@fredizzimo
Copy link

fredizzimo commented Sep 30, 2023

Sorry for the vague bug report.

We have trouble with the IME system on Windows where we use a separate render thread, for example the positions are not updating. I have not looked further into it, but it appears like it's not safe to use in a multi-threaded manner by default.

https://learn.microsoft.com/en-us/windows/win32/intl/developing-ime-aware-multiple-thread-applications.

So that seems like the most likely reason. I think we can work around this on the Neovide side, but it would be nice if the user did not have to care.

@fredizzimo
Copy link
Author

I guess the simplest implementation would be to use a single IME context, the default, and run all the Imm* functions on the main thread. Otherwise there needs to be an API for creating contexts associated with threads, and I don't really see a use case for multiple contexts, especially since it's not supported on all platforms.

@kchibisov
Copy link
Member

Doing main-thread roundtrips sounds good enough. Windows backend already has a main thread running so should ok to add?

@fredizzimo
Copy link
Author

Yes, at least in our case that should be enough.

kchibisov added a commit to kchibisov/winit that referenced this issue Oct 20, 2023
Execute the calls to the IME from the main thread.

Fixes rust-windowing#3123.
kchibisov added a commit that referenced this issue Oct 20, 2023
Execute the calls to the IME from the main thread.

Fixes #3123.
kchibisov added a commit to kchibisov/winit that referenced this issue Oct 21, 2023
Execute the calls to the IME from the main thread.

Fixes rust-windowing#3123.
kchibisov added a commit that referenced this issue Oct 21, 2023
Execute the calls to the IME from the main thread.

Fixes #3123.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants