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

Update IME position more frequently #7651

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

uiryuu
Copy link

@uiryuu uiryuu commented Jan 21, 2024

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:

  • Change typing language to English (turn off IME)
  • Open Alacritty
  • Start typing using IME, the initial position will be wrong

Or:

  • Open Alacritty
  • Type in English for a few characters
  • Switch to another language which uses IME, the position will be wrong

The bug might only reproducible for some languages' IME depending on whether the IME immediately pup up the candidate window or not.

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 {
Copy link
Member

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.

Copy link
Author

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.

image
Screenshot 2024-01-22 at 17 26 26

So with the current implementation, the user will never get a correct text accessory view position when they are enabling caps lock on macOS.

Copy link
Member

@kchibisov kchibisov Jan 23, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants