rust-windowing / rust-windowing/winit

Cannot disable IME or set IME position on X11

Open
#3,092 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

DS - x11
Dominant language
Rust
Stars
6.2k
Forks
1.3k
Avg merge
2d 19h
Merged PRs (30d)
9

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/platform_impl/linux/x11/ime/input_method.rs around the IME style selection and src/platform_impl/linux/x11/ime/context.rs around the XSetICValues call. Investigate how the listed X11 input styles affect disabling IME, preedit events, and position updates; done means IME can be disabled and its position can be set without losing useful preedit text.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, rust
Domain
desktop, internationalization
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.