rust-windowing / winit

Window handling library in pure Rust
https://docs.rs/winit/
Apache License 2.0
4.87k stars 910 forks source link

X11: Use bottom-right corner of IME cursor area as caret position. #3966

Closed xorgy closed 1 week ago

xorgy commented 1 month ago

XIM servers currently do not support preedit area reporting from clients and there may be no standard way to report it.

Fcitx and iBus both place the candidate window descending descending from the caret, with the reported X font; but since winit does not report a font, the height of the line is assumed 0, so when we report the top left corner of the cursor area they will tend to obscure it.

Taking this into account, the best default option is to report the bottom right corner of the cursor area, because it will tend not to obscure the preedit area when using Window::set_ime_cursor_area in the way suggested by documentation.

Fixes #3965

xorgy commented 4 weeks ago

That's fair, I can add documentation changes to that effect, and a couple comments in the backend mentioning other possible ways to do preedit area reports (though I haven't found any IM servers implementing PreeditArea so far).

xorgy commented 4 weeks ago

I've added more to the documentation about the behavior, and added comments for rationale.