IME: Render overlay at the last visible cursor position and improvements under macOS - #6049
Conversation
…te cursor Fix the problem caused by wrong cursor coordinates. No more messing with the main cursor, instead the cursor is saved when receiving a pre-edit text update and used for drawing later. Update the overlay to the last visible cursor position before rendering to ensure it always moves with the cursor. Finally, draw the overlay after line rendering is complete, and restore the line buffer after updating the rendered data to ensure that the line text being read is correct at all times. This also improves performance by only rendering once when changes are made, eliminating the need to repeatedly disable and draw after various commands and not even comprehensively.
IME will automatically get the display position when needed, which keeps it consistent with the overlay as much as possible. Fix the issue that when IME is activated after mouse click, it is displayed at the wrong position.
|
I dont recall I think I tested the writetopasteboard not the readfrompasteboard. But I think there are some chinese translation services or something like that that export text. Also terminal.app support these services so selecting text there might be a way to test it. |
I did the same.
I believe this is for After updating to the latest commit, I'm experiencing a crash just by pressing some keys after startup. |
Render overlay at the last visible cursor position with a separate cursor.
Fix the problem caused by wrong cursor coordinates. No more messing with the main cursor, instead the cursor is saved when receiving a pre-edit text update and used for drawing later.
Update the overlay to the last visible cursor position before rendering to ensure it always moves with the cursor. Finally, draw the overlay after line rendering is complete, and restore the line buffer after updating the rendered data to ensure that the line text being read is correct at all times.
This also improves performance by only rendering once when changes are made, eliminating the need to repeatedly disable and draw after various commands and not even comprehensively.
Allow IME to actively get the cursor position in real time on macOS.
IME will automatically get the display position when needed, which keeps it consistent with the overlay as much as possible.
Fix the issue that when IME is activated after mouse click, it is displayed at the wrong position.
After the window is created, the initial activation of the IME will be in whatever position the cursor is located, not in the upper left corner.
Tested on:
Supersedes:
#6002
Please review, thank you.