-
Notifications
You must be signed in to change notification settings - Fork 903
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
set_ime_cursor_area
uses the top left corner of the rectangle as the composition/cursor point on X11
#3965
Comments
I think the docs mention that it's not implemented on X11? The issue is mostly that I don't think there's an API for that, winit could try to e.g. put the thing below what was submitted, but it could break. |
The APIs you see on other platforms require you to pass a rectangle to not obscure an area, so they are just different and compositor positions the window in a way to not obscure it. |
@kchibisov The problem is that if you use this API as documented, you will obscure your text 100% of the time with the most common X11 IME (iBus). If you ignore the documentation and send only a Position at the baseline with no size, you get usable behavior most of the time, but then you are misusing the API on every other platform. The API being called in the X11 backend as far as I'm aware is meant to be given the equivalent of |
Of course, you could also make a case for adding |
The thing is that none of that will happen with any of the other backend, though, it' x11 and i don't care that much. |
Alright so I've talked with Fcitx @wengxt and he's willing to accept an attribute on the XIM IC, I'll see if I can confirm with Mr. Fujiwara about a name for the attribute for adding this to iBus as well. |
Description
On X11, unlike other platforms (windows, macOS),
Window::set_ime_cursor_area
behaves differently from how it is described in the documentation.In particular, it ignores the height of the rectangle, and submits the top left corner as the composition/insertion point:
winit/src/platform_impl/linux/x11/window.rs
Lines 2034 to 2042 in c913cda
Whereas on Windows, the height is added to produce the equivalent:
winit/src/platform_impl/windows/ime.rs
Lines 123 to 126 in c913cda
And on Mac, NSView gives a rectangle for this operation, which the system will avoid placing the candidate window over (still assuming the bottom left corner, typically)
winit/src/platform_impl/apple/appkit/view.rs
Lines 370 to 384 in c913cda
This results in the candidate window being reliably placed overtop the preedit text, without platform-specific workarounds.
OS and window mananger
Xorg 21
Winit version
0.30.5
The text was updated successfully, but these errors were encountered: