app: [Wayland] add IME support - #177
Draft
bigwolfeman wants to merge 1 commit into
Draft
Conversation
bigwolfeman
force-pushed
the
app-wayland-ime
branch
2 times, most recently
from
August 12, 2026 04:31
864e4fc to
3a32a4d
Compare
eliasnaur
reviewed
Aug 12, 2026
Comment on lines
+115
to
+123
| imFocus *window | ||
| imSerial uint32 | ||
| imActive bool | ||
| imDirty bool | ||
| imExternal bool | ||
| imHint key.InputHint | ||
| pending textInputUpdate | ||
| sent textInputSnapshot | ||
| sentValid bool |
Contributor
There was a problem hiding this comment.
This is quite a bit of state to keep in the driver. I haven't looked closely at the changes (and the PR is in draft), but my impression is that some of this should be subsumed by the general IM machinery in ime.go and ime_test.go. In short, drivers are meant to be minimal because they're plural and hard to test. Even if some machinery is required just for one platform, it's usually better to implement that in general purpose Go to make it hackable and testable everywhere.
Wayland currently handles text input as key events, so input methods cannot provide preedit text, commits, or surrounding-text edits. Bind text-input-v3 for each seat and apply its preedit, commit, and deletion events atomically on done. Report surrounding text, cursor bounds, and content purpose with UTF-8 byte offsets as required by the protocol. Add tests for transaction ordering, serial synchronization, nullable events, UTF-8 deletion ranges, and the 4000-byte surrounding-text limit. Related discussion: https://lists.sr.ht/~eliasnaur/gio/%3C87tsyhhjkm.fsf@inet.name%3E Signed-off-by: bigwolfe <15391393+bigwolfeman@users.noreply.github.com>
bigwolfeman
force-pushed
the
app-wayland-ime
branch
from
August 15, 2026 20:12
3a32a4d to
613ce38
Compare
Author
|
Changed based on your input. Created imState to maintain the state that is not necessarily Wayland unique. Driver is kept as minimal as possible. |
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.
Summary
text-input-v3for each Wayland seatdonetransactionsRelated discussion:
https://lists.sr.ht/~eliasnaur/gio/%3C87tsyhhjkm.fsf@inet.name%3E
Testing
go test ./app -run '^TestTextInput' -count=1go test ./app -count=1go build ./appinput-method-v2deletion across the multibyte texté🙂, followed by a commit in the same transaction