winit icon indicating copy to clipboard operation
winit copied to clipboard

Cannot disable IME or set IME position on X11

Open Riateche opened this issue 2 years ago • 3 comments

IME cannot turn off on my system. Even if IME was not enabled for the window, it still receives IME events. set_ime_enabled() has no effect. This can be problematic for applications that don't have IME event handlers.

The relevant code is here. The available styles on my system are: 0x402, 0x404, 0x408, 0x202, 0x204, 0x208. There is no XIM_NONE_STYLE, so the implementation uses the same style (0x402) for "preedit" and "none" modes. None of the available styles actually disable IME.

Setting IME position also doesn't work. There is a comment here, linking to a 20 year old issue. XSetICValues call does, in fact, return an error "preeditAttributes". Does it mean that there is no way to fix it? Setting IME position works in other applications, so it must be possible.

I've played around with other styles. If I enable 0x208 or 0x408, setting IME position actually works, but in these modes the application doesn't receive IME preedit events with actual preedit text (only a single event with an empty preedit, followed by a commit with the final text). So this is also not perfect.

Riateche avatar Sep 10 '23 11:09 Riateche

None of the available styles actually disable IME.

Should be sort of resolved once we update to xcb and our implementation of ime stuff, but with xim I'm not sure we can.

I've played around with other styles. If I enable 0x208 or 0x408, setting IME position actually works, but in these modes the application doesn't receive IME preedit events with actual preedit text (only a single event with an empty preedit, followed by a commit with the final text). So this is also not perfect.

That's unfortunatelly how it works, unless you update xlib.

Setting IME position also doesn't work. There is a comment here, linking to a 20 year old issue. XSetICValues call does, in fact, return an error "preeditAttributes". Does it mean that there is no way to fix it? Setting IME position works in other applications, so it must be possible.

update your xlib, it should work with the most recent one since my patch was accepted to fix xlib.

kchibisov avatar Sep 11 '23 06:09 kchibisov

That's great news! I can confirm that IME positioning now works with xlib 1.8.4 (looks like the fix was merged into xlib 1.8.2).

Riateche avatar Sep 13 '23 20:09 Riateche

Are there any news for this issue? the current egui master is unusable with x11, because IME is always activated, even if i don't use it.

I use KDE x11 on debian sid. Apparently it also happens on other window managers like i3

StarStarJ avatar Aug 27 '24 15:08 StarStarJ