Skip to content

Fix Korean IME composition on macOS - #1166

Closed
sasca37 wants to merge 1 commit into
dail8859:masterfrom
sasca37:fix/macos-korean-ime
Closed

sasca37 wants to merge 1 commit into
dail8859:masterfrom
sasca37:fix/macos-korean-ime

Conversation

@sasca37

@sasca37 sasca37 commented Oct 18, 2026

Copy link
Copy Markdown

Problem

On macOS, typing Korean (Hangul) with the system IME has two problems:

  • Deleting the last jamo of a composition inserts a literal BS (0x08)
    character into the document.
  • Typing a digit/symbol (e.g. !) while a syllable is being composed
    replaces the composing syllable instead of keeping it.

Cause

I logged QInputMethodEvent on macOS (Qt 6.12, built-in Korean IME):

  • Deleting the last jamo arrives as commit="\b".
  • ! arrives as commit="!" while preedit="아" is pending; the
    composition is undone and never committed.

Changes

The behavior changes are guarded by Q_OS_MACOS, so other platforms
are unaffected. (A new member variable and a local copy of the commit
string are the only code outside the guard; they do not change behavior.)

  1. Ignore a "\b" commit.
  2. If a single ASCII character is committed while a Hangul preedit is
    pending, keep the preedit. Hanja / kana conversion should not be
    affected, since those commits are not a single ASCII char.

Testing

  • macOS (Apple Silicon, Qt 6.12): typed Korean sentences with spaces,
    deleted mid-composition, typed symbols/digits right after a syllable.
    All behave as expected.
  • I could not test on Windows or Linux. The logic is compiled only on
    macOS.

On macOS, the Hangul IME sends two events that were mishandled:

- Deleting the last jamo of a composition is reported as a commit of
  "\b", which was inserted as a literal BS character.
- Typing an ASCII character (e.g. "!") while a syllable is being
  composed commits only that character, and the composing syllable
  was lost.

Handle both cases, guarded by Q_OS_MACOS so other platforms are
unaffected. Hanja and kana conversion are not affected.
@dail8859

Copy link
Copy Markdown
Owner

Appreciate the PR but everything under ‎thirdparty/scintilla/* is used as-is from the Scintilla project so any bug fixes for the actual Scintilla sorce code would need submitted to that project.

@dail8859 dail8859 closed this Oct 24, 2026
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.

2 participants