[PR #4347] [MERGED] Accept IME text composition in the game's text fields #5575

Closed
opened 2026-11-03 05:13:31 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4347
Author: @DUzzL
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @levzzz5154

Base: main ← Head: fix/issue-4338-ime-commit


📝 Commits (3)

  • 21bdf4f Accept committed IME text in the focused text field
  • e2dbf8a Enable the input method in World Options only while a text box has focus
  • 1d383e7 Merge remote-tracking branch 'hr/main' into fix/pr-4347

📊 Changes

4 files changed (+96 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+8 -0)
📝 crates/horizon-client/src/game/dialogs.rs (+8 -0)
➕ crates/horizon-client/src/game/ime.rs (+73 -0)
📝 crates/horizon-client/src/game/lan_screen.rs (+7 -0)

📄 Description

🤖 Opened by DUzzL's AI agent, not by DUzzL personally.

Refs #4338. This is a partial fix: it does not close the issue.

Cause: the window did not accept IME (input method) composition, so text entry in the game's fields did not take IME input.

Change: a new game/ime.rs allows IME only while a text field has focus, checked each frame. WindowEvent::Ime(Commit) sends the committed text to the same sinks that horizon-ctl type uses. A commit with no focused field is dropped. Covered: title, dialogs, sign, book, chat, command block, creative search, mod browser, recipe search, anvil and the World Options text boxes. IME is off outside these fields, so movement keys are unchanged.

Not done: preedit (composition) drawing and set_ime_cursor_area are missing. The startup menu, the Options search boxes and the title-screen game-rule boxes are not covered.

Tested: cargo fmt --check and cargo clippy -p horizon-client --all-targets -- -D warnings pass. cargo test -p horizon-client --lib gives 731 passed and 1 failed: title::tests::each_world_preset_writes_its_own_generator (an OS "not a directory" error in the title test, outside this diff; the failure is pre-existing). cargo test -p horizon-client --bins passes (206 + 18). No new tests.

Not tested: no IME run (no Korean or Japanese IME), so composition behaviour is unchecked. tools/pr_ready.py not run.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/4347 **Author:** [@DUzzL](https://github.com/DUzzL) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix/issue-4338-ime-commit` --- ### 📝 Commits (3) - [`21bdf4f`](https://github.com/horizon-rust/horizon/commit/21bdf4f9a3bce2ff562216fdb99dbc5d55e753f8) Accept committed IME text in the focused text field - [`e2dbf8a`](https://github.com/horizon-rust/horizon/commit/e2dbf8a03f16b65fa583c5f63de85696b6181723) Enable the input method in World Options only while a text box has focus - [`1d383e7`](https://github.com/horizon-rust/horizon/commit/1d383e73b3bf702abee730682b21eb699afde419) Merge remote-tracking branch 'hr/main' into fix/pr-4347 ### 📊 Changes **4 files changed** (+96 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+8 -0) 📝 `crates/horizon-client/src/game/dialogs.rs` (+8 -0) ➕ `crates/horizon-client/src/game/ime.rs` (+73 -0) 📝 `crates/horizon-client/src/game/lan_screen.rs` (+7 -0) </details> ### 📄 Description > 🤖 Opened by DUzzL's AI agent, not by DUzzL personally. Refs #4338. This is a partial fix: it does not close the issue. **Cause:** the window did not accept IME (input method) composition, so text entry in the game's fields did not take IME input. **Change:** a new `game/ime.rs` allows IME only while a text field has focus, checked each frame. `WindowEvent::Ime(Commit)` sends the committed text to the same sinks that `horizon-ctl type` uses. A commit with no focused field is dropped. Covered: title, dialogs, sign, book, chat, command block, creative search, mod browser, recipe search, anvil and the World Options text boxes. IME is off outside these fields, so movement keys are unchanged. **Not done:** preedit (composition) drawing and `set_ime_cursor_area` are missing. The startup menu, the Options search boxes and the title-screen game-rule boxes are not covered. **Tested:** `cargo fmt --check` and `cargo clippy -p horizon-client --all-targets -- -D warnings` pass. `cargo test -p horizon-client --lib` gives 731 passed and 1 failed: `title::tests::each_world_preset_writes_its_own_generator` (an OS "not a directory" error in the title test, outside this diff; the failure is pre-existing). `cargo test -p horizon-client --bins` passes (206 + 18). No new tests. **Not tested:** no IME run (no Korean or Japanese IME), so composition behaviour is unchecked. `tools/pr_ready.py` not run. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:13:31 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#5575
No description provided.