Settle composition state on focus change, reset, disable - #611
Open
EzeriumChristinal wants to merge 1 commit into
Open
EzeriumChristinal wants to merge 1 commit into
EzeriumChristinal wants to merge 1 commit into
Conversation
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Typing a half-finished word and switching windows committed the pending preedit into the new window: FocusOut did nothing, so the next FocusIn flushed the stale buffer wherever focus happened to be.
FocusOut now settles the buffer first — pending preedit goes to the window losing focus, and emoji/hex/input-mode popups close. Reset clears the buffer in backspace modes instead of only Preedit. Disable drops pending state so nothing leaks into the next Enable.
FocusIn and Enable set the one-shot surrounding-text gate before asking IBus; before, the gate stayed shut except after cursor moves, so the request did nothing. SetSurroundingText ignores an active selection, and the payload decode accepts the shapes godbus can deliver instead of indexing the variant blindly (which panicked on anything else). Home counts as a movement key, like End.
Tests: buffer Reset/FocusOut/Home tests, FocusOut-commits-to-loser, surrounding decode and rebuild (
engine_regression_test.go).go vetclean,go testandgo test -racepass.