slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
17.52k stars 598 forks source link

Redundant display when input Chinese on LineEdit (or TextEdit) #5982

Open Horbin-Magician opened 2 months ago

Horbin-Magician commented 2 months ago

Win11, Slint1.7.2, renderer-skia-opengl, Rust

I found that extra initial are rendered below the input box when , it is redundant.

This will only happen when you type immediately after the input box has gained focus, like:

https://github.com/user-attachments/assets/82d976ae-908e-420a-ad21-3267da28c9ad

image

If it's more difficult for you to reproduce, please let me know as much information as possible about the code and I'll be happy to help deal with this problem.

Below is my demo code: lineedit_demo.zip

ogoffart commented 2 months ago

This is probably a problem in winit.

tronical commented 1 month ago

I can reproduce this with plain windows 11 and (simplified) Chinese input. (happens with any renderer, etc.)

Horbin-Magician commented 1 month ago

I have submit this problem on Winit, refering: https://github.com/rust-windowing/winit/issues/3893

This issue may be caused by WM_IME_SETCONTEXT msg failing to hide composing text drawn by IME timely.