-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Update IME position more frequently #7651
Conversation
Currently the IME position is only updated when the IME is enabled. So the initial position of the IME will be wrong. Changed to update position even if the IME is off.
@@ -900,15 +900,17 @@ impl Display { | |||
}; | |||
|
|||
// Handle IME. | |||
if self.ime.is_enabled() { | |||
if let Some(point) = ime_position { | |||
if let Some(point) = ime_position { |
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.
Winit should indicate that the IME got enabled and you should schedule an update from it, always updating doesn't make any sense and the input into terminal should correctly reposition, since you'll likely have preedit going.
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 tried a little bit, the Ime::Enabled
is only generated when the user starts typing, so we have no idea when the user switched the IME. On macOS, when the user is changing the IME (or just toggle caps lock, see the picture below), the text accessory view will appear on the last position you set.
So with the current implementation, the user will never get a correct text accessory view position when they are enabling caps lock on macOS.
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.
What happens when you press CapsLock
, do we have any keyboard events in general for it? Maybe something in --print-events
appears with KeyEvent?
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.
@kchibisov the only lines logged when I toggle caps-lock or switch input languages on macOS is [INFO ] [alacritty_winit_event] About to wait
.
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 mean, it's maybe not delivered from the winit itself. Generally I'm not that much against updating the IME more frequently just on macOS, but I'd like to know a better entry point for such stuff in general.
Currently the IME position is only updated when the IME is enabled. So the initial position of the IME will be wrong if the IME is not enabled. Changed to update position even if the IME is off.
Steps to reproduce the bug:
Or:
The bug might only reproducible for some languages' IME depending on whether the IME immediately pup up the candidate window or not.