Skip to content

feat(ime): minimal IME support for the text_box widget#539

Merged
jklgrasso merged 3 commits intopop-os:masterfrom
kenz-gelsoft:minimal-input-method-support
Apr 27, 2026
Merged

feat(ime): minimal IME support for the text_box widget#539
jklgrasso merged 3 commits intopop-os:masterfrom
kenz-gelsoft:minimal-input-method-support

Conversation

@kenz-gelsoft
Copy link
Copy Markdown
Contributor

@kenz-gelsoft kenz-gelsoft commented Mar 1, 2026

Fix the cosmic-edit specific part of pop-os/cosmic-epoch#2174.

The input method support in iced 14.0 requires text widgets to implement some logic to support input method input.

This PR includes this for the cosmic-edit specific text widgets in text_box.rs.

2026-03-24.23-54-27.mp4

FYI, my old PR of backporting the IME feature may be a good reference to add IME support for an existing custom text widget. See text_editor.rs:


For text components other than text_box, the following PRs will add IME support:

(I will force-push this branch to update my fork to rebase to newer upstream rev)


  • I have disclosed use of any AI generated code in my commit messages.
    • If you are using an LLM, and do not fully understand the changes it is making to the code base, do not create a PR.
    • In our experience, AI generated code often results in overly complex code that lacks enough context for a proper fix or feature inclusion. This results in considerably longer code reviews. Due to this, AI authored or partially authored PRs may be closed without comment.
  • I understand these changes in full and will be able to respond to review comments.
  • My change is accurately described in the commit message.
  • My contribution is tested and working as described.
  • I have read the Developer Certificate of Origin and certify my contribution under its conditions.

@kenz-gelsoft kenz-gelsoft marked this pull request as ready for review March 1, 2026 01:40
@kenz-gelsoft kenz-gelsoft changed the base branch from iced-rebase to master March 5, 2026 12:19
@kenz-gelsoft kenz-gelsoft marked this pull request as draft March 5, 2026 12:20
@kenz-gelsoft kenz-gelsoft force-pushed the minimal-input-method-support branch 3 times, most recently from af425d0 to 610337d Compare March 18, 2026 22:02
@kenz-gelsoft kenz-gelsoft changed the title Implement input method support to COSMIC-edit specific text widgets (for iced-rebase branch) Implement minimal IME support to COSMIC-edit specific text widget Mar 18, 2026
@kenz-gelsoft kenz-gelsoft marked this pull request as ready for review March 18, 2026 22:04
@kenz-gelsoft kenz-gelsoft force-pushed the minimal-input-method-support branch 3 times, most recently from 6d9c912 to a3e184d Compare March 24, 2026 14:55
@kenz-gelsoft
Copy link
Copy Markdown
Contributor Author

kenz-gelsoft commented Apr 1, 2026

I have a trivial fix not pushed.

@kenz-gelsoft kenz-gelsoft marked this pull request as draft April 1, 2026 22:04
@kenz-gelsoft kenz-gelsoft changed the title Implement minimal IME support to COSMIC-edit specific text widget Implement minimal IME support for COSMIC-edit specific text widget Apr 2, 2026
@kenz-gelsoft kenz-gelsoft force-pushed the minimal-input-method-support branch from a3e184d to 2dbc40b Compare April 2, 2026 16:34
@kenz-gelsoft kenz-gelsoft marked this pull request as ready for review April 2, 2026 21:36
@kenz-gelsoft kenz-gelsoft force-pushed the minimal-input-method-support branch from e202001 to 2898691 Compare April 3, 2026 22:02
@kenz-gelsoft kenz-gelsoft changed the title Implement minimal IME support for COSMIC-edit specific text widget feat(ime): minimal IME support for the text_box widget Apr 3, 2026
@kenz-gelsoft kenz-gelsoft force-pushed the minimal-input-method-support branch 2 times, most recently from f96bbed to 7546e73 Compare April 10, 2026 21:48
Use the previous caret(text cursor) position to place the input method
window when the position is not available
- iced UserInterface.update() starts with InputMethod::Disabled state,
  and merges any input_method_request() which is InputMethod::Enabled in
  widgets tree traversal.
- We don't enable the input method feature if the widget doesn't have
  focus, we can safely omit request_input_method() call itself.
@kenz-gelsoft kenz-gelsoft force-pushed the minimal-input-method-support branch from 7546e73 to 0d532e6 Compare April 14, 2026 21:40
@jackpot51 jackpot51 requested review from a team April 14, 2026 21:45
@kenz-gelsoft
Copy link
Copy Markdown
Contributor Author

Hi, is this waiting for QA?

My understanding is your QA will ensure my change doesn't break existing use-cases (mainly System76 hardware customers' non-IME use-cases).

Any input will help?

@jklgrasso jklgrasso self-assigned this Apr 22, 2026
Copy link
Copy Markdown

@jklgrasso jklgrasso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checklist:

Basic operations

  • Type three lines of text (no trailing newline).
  • Copy the last two lines.
  • Paste at the end of the third line (file should now have four lines).
  • Ctrl-Z to undo the paste.
    • Selecting text without using 'ctrl' causes undo to remove more than expected. Not a regression. Issue #564 created to address
  • Press Enter to add a trailing newline.
  • Paste again (file should now have five lines).
  • Ctrl-Z to undo the paste.
  • Ctrl-Shift-Z to redo the paste.
  • Save the file.
  • Ctrl-F and search for something that has a match.
  • Press Esc twice to exit the Find dialog.
  • Press Ctrl-X to cut the selected search result.
  • Paste the cut text on a new line (file should now have six lines).
  • Re-save the file.
  • Narrow the window until the lines start wrapping (make a line longer if necessary to observe line wrapping).
  • Turn word wrapping off.
  • Scroll right to the end of the document, then left to the beginning again.
  • Click and drag to select some text past the horizontal edge of the window.
  • Close the file, open COSMIC Edit again, and open the file via the recents list.
    • Does not work. Not a regression
  • Close the file again, open COSMIC Edit again, and open the file via the Open dialog.
  • Turn word wrapping back on.

Settings

  • Open View -> Settings.
  • All Appearance settings work.
  • Vim bindings work.

Projects & Git Management

  • Clone the cosmic-edit Git repo and open its directory as a project.
  • Edit -> Find in project... works.
  • Make a change in a file.
  • File -> Git management shows the change and staging it works.
  • Make another change while Git management's open; it updates to show the new change.

@jklgrasso jklgrasso merged commit 4c53d60 into pop-os:master Apr 27, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants