Repository navigation
[Windows][IME] Capture IMM32 composition state at notification time - #6428
Merged
akleshchev merged 2 commits intoOct 15, 2026
Merged
akleshchev merged 2 commits into
akleshchev merged 2 commits into
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
Contributor
Author
|
I have read the CLA Document and I hereby sign the CLA |
akleshchev
approved these changes
Oct 12, 2026
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Fix the second-read validation so partial or zero-length reads are treated as unavailable.
1 open finding
What changed in this PR
Captures IMM32 composition data when WM_IME_COMPOSITION arrives, preventing queued callbacks from reading newer IME state.
Changes:
- Adds immutable IME composition snapshots.
- Queues snapshots instead of composition flags.
- Applies captured data on the main thread.
- Preserves empty and reset handling.
| File | Summary |
|---|---|
indra/llwindow/llwindowwin32.h |
Updates the composition handler interface for snapshots. |
indra/llwindow/llwindowwin32.cpp |
Captures and processes IME snapshots; second reads should require an exact-length result before being considered available. |
🧠 Review effort: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
|
Thank you, merging! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Capture the Windows IMM32 composition data synchronously when
WM_IME_COMPOSITIONis received, then pass that immutable snapshot to the queued main-thread handler instead of re-reading mutable IME state later.Fixes #6406.
Problem
The current Windows IME path queues only the
WM_IME_COMPOSITIONflags:handleCompositionMessage()then callsImmGetCompositionString()later on the queued application/main-thread callback.IMM32 composition state is mutable. If another IME notification arrives before the queued callback runs, the older notification can be combined with a newer composition/result/attribute/clause/cursor state.
With Microsoft Japanese IME this can present as delayed preedit updates, bursts, dropped or duplicated characters, or apparent rollback to an earlier composition state.
Change
WM_IME_COMPOSITION.LLImeCompositionSnapshot.indexes == 0reset behavior.This intentionally does not change the pre-existing cursor bounds condition in
handleCompositionMessage(); that is separate from the notification/state-correlation issue.Validation
The runtime instrumentation and user-visible reproduction were performed in Firestorm 7.2.4.80712 on Windows 11 with Microsoft Japanese IME.
Firestorm inherits the affected
WM_IME_COMPOSITION/LLWindowWin32::handleCompositionMessage()path from the Second Life viewer.A/B instrumentation over the same Nearby Chat workload showed:
Current / dequeue-time behavior
Notification-time snapshot behavior
Result-string cases
The equivalent Firestorm fix was built successfully and then used normally for approximately one week without recurrence of the original Japanese input lag / rollback / dropped-or-duplicated-character symptom.
I have not independently reproduced the user-visible symptom in an official Second Life Viewer binary.
The contribution is based on the identical affected upstream code path plus the Firestorm runtime evidence above.
Current upstream base
This PR is based on current
developat:d36d6a2fc4The patch applies cleanly and
git diff --checkpasses.