-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Fix the initial candidate window position #2793
base: master
Are you sure you want to change the base?
Conversation
I think this is sane fix for the problem I catched earlier on original PR: I investigated winit's macOS platform code and I find it correctly updates the internal And as far as I tested macOS iuput methods doesn't reposition immediately while it is currently displayed. This is not only on winit apps but also on native macOS apps. So this is not a bug of winit but is a cross platform limitation. We need to Sorry about the misinformation on the decision of the initial API design. |
EDIT: Sorry this is bad. This can't express the Open state with on-the-spot preedit. |
That sounds also work and simpler. Basically agree. One downside on it is that |
But I have an idea for avoiding the downside. So I'd like to suggest to make a PR with the commit by @kenz-gelsoft and then I will send a PR to your fork. |
@hecrj Sorry for disturbing, I proposed merging Allowed and Open states in this PR, but it was not simple to handle in this PR. I think this PR should be included in the first release (0.14 I expects) which supports input method. Please review this as-is. |
Co-authored-by: rhysd <[email protected]> Co-authored-by: KENZ <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have simplified the InputMethod
API to have only 2 states: Disabled
and Enabled
.
Could you test and make sure everything works as expected?
@hecrj Thank you for reworking my patch. As far as I tried, it worked fine. (Checked only |
Fixes #2792. Closes #2800.
The issue is that the candidate window is already open when
InputMethod::Open
event is handled in the window manager. Sinceset_ime_cursor_area
is not called yet when the window is opened, the position of the window is at the top left corner.To fix this, we need to call
set_ime_cursor_area
earlier before the window is opened. winit's example calls the function just after callingset_ime_allowed
.This PR calls the function when allowing IME so
InputMethod::Allowed
event now has the position of the window.Here is the video:
fix.mp4