rust-windowing / rust-windowing/winit

New IME API is too restrictive

Open
#4,412 25 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

In short, I want to use the "cursor area" capability, but provide the area through an update later. The old v0.30.x IME API allowed that and it worked.

With the new API:

    let capabilities = ImeCapabilities::new().with_hint_and_purpose().with_cursor_area();
    let data = ImeRequestData::default().with_hint_and_purpose(hint, purpose);
    let req = ImeEnableRequest::new(capabilities, data.clone()).unwrap();

fails to unwrap() because I haven't provided the cursor area yet. Alternatively if I don't unable .with_cursor_area() then I get errors later:

2025-11-17T14:30:07Z WARN  winit_wayland::seat::text_input] discarding IME cursor area update without capability enabled.

Given that hint, purpose and surrounding text are widget-level details (content) while position is a window-level detail (a widget has no idea what translations may have been used), I find it surprising that both constructs are tied into the same "update". Essentially it forces me to keep a copy of the widget-level details at the window-level.

Also, why can ImeEnableRequest::new fail in the first place? Why even require that capabilities be specified explicitly if the specification requires that they match provided data exactly — can we not just implement From<ImeRequestData> for ImeEnableRequest?

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 the ImeCapabilities, ImeRequestData, and ImeEnableRequest APIs shown in the issue, and compare their behavior with the old v0.30.x IME API. Reproduce the unwrap failure and the winit_wayland warning, then determine an API design that permits the cursor area to be supplied later without requiring duplicated widget-level data; the specification's capability and data requirements should remain satisfied.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.