emilk / emilk/egui

On Linux X11 + Fcitx5, IME pre-edit text is not in `TextEdit`

Open
#7,975 2 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
30.6k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
72

Description

**Describe the bug**

My setups:
- X11 + Fcitx5 (the buggy one): Debian 13 [Cinnamon 6.4.10 + X11 + Fcitx5 5.1.2]
- Wayland + IBus (for reference): Fedora KDE Plasma Desktop 43 [Wayland + IBus 1.5.33-rc2]

For both setups, the Korean IME I used is the same one called “Hangul” with the same icon. (The about page of the IBus one states that the author is Peng Huang. I can't find the about page for the Fcitx5 one. The Fcitx5 one has this description: “Hangul Wrapper For Fcitx”)

I am not sure whether this behavior is caused by X11 or Fcitx5.
It is also unclear whether this should be addressed in egui (via winit usage) or whether it is a limitation in winit itself and an issue should be opened there.

For now, I am documenting the observed behavior here as a starting point.

IME pre-edit text works correctly in applications like LibreOffice on my X11 + Fcitx5 setup

Chinese Example:
![Image](https://github.com/user-attachments/assets/45717030-df7f-45ad-8ad1-0423ea3fd860)

Korean Example:
![Image](https://github.com/user-attachments/assets/4f65b78b-cea5-4fe1-beae-7d7daa9bd75f)

IME pre-edit text works correctly in egui on my Wayland + IBus setup

Chinese Example:
![Image](https://github.com/user-attachments/assets/8f47a50d-9700-4fd5-b6fb-24748939614a)

Korean Example:
![Image](https://github.com/user-attachments/assets/f46df14b-9e6b-4c94-ba66-26453fc19e7d)

IME pre-edit text is not in TextEdit in egui on my X11 + Fcitx5 setup

Chinese Example:
![Image](https://github.com/user-attachments/assets/26b1327d-e735-4562-888f-0588c3602603)

Korean Example:
![Image](https://github.com/user-attachments/assets/64306813-0409-4d15-a04e-bc1648305098)
(It appears that the Korean IME is in some kind of compatibility mode where the pre-edit text is displayed in a separate text control instead of inside the application.)

This is not a big deal for Chinese or Japanese IMEs.
But for Korean IMEs, since the pre-edit text is not part of the `TextEdit` buffer under X11 + Fcitx5, losing focus on the `TextEdit` causes uncommitted Hangul characters to be dropped.

Uncommitted Hangul remains after losing focus on Wayland + IBus (correct behavior)

![Image](https://github.com/user-attachments/assets/62363a1f-e1d6-4b25-90f1-55d0053d4629)

Uncommitted Hangul is lost after losing focus on X11 + Fcitx5 (incorrect behavior)

![Image](https://github.com/user-attachments/assets/899d95ec-4232-4db0-a045-742539824013)

Notice that the third Hangul character is missing.

**To Reproduce**
Steps to reproduce the behavior:
1. run the demo App.
2. open the TextEdit demo.
3. type with various IMEs.

**Expected behavior**
The X11 + Fcitx5 setup should work like the Wayland + IBus setup.

**Screenshots**
See above.

**Desktop (please complete the following information):**
- OS: Debian 13 [Cinnamon 6.4.10 + X11 + Fcitx5 5.1.2]
- Native (eframe+wgpu)
- Version [current main] (between 0.33.3 and the next release. 0.33.3 is even more broken: IMEs only works when the cursor is at the beginning.)

[current main]: https://github.com/emilk/egui/commit/14afefa2521d1baaf4fd02105eec2d3727a7ac36

Contributor guide

Open the contributing guide

Research direction

Start with the TextEdit demo on the current main commit and reproduce the issue under X11 + Fcitx5, comparing it with Wayland + IBus. Trace whether the missing pre-edit text belongs to egui or its winit usage. Done means uncommitted Hangul remains in the TextEdit when it loses focus, matching the expected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop, frontend, internationalization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.