Thank you for attaching the log. ``` I/IMEHandler 0x7f07dc4455e0 OnChangeCompositionNative(aContext=0x7f07c78fa170), mComposingContext=0x7f07c78fa170 I/IMEHandler 0x7f07dc4455e0 GetCompositionString(aContext=0x7f07c78fa170), aCompositionString="의" I/IMEHandler 0x7f07dc4455e0 DispatchCompositionChangeEvent(aContext=0x7f07c78fa170) I/IMEHandler 0x7f07dc4455e0 CreateTextRangeArray(aContext=0x7f07c78fa170, aCompositionString="의" (Length()=1)) D/IMEHandler 0x7f07dc4455e0 SetTextRange(), succeeded, aTextRange= { mStartOffset=0, mEndOffset=1, mRangeType=TextRangeType::eRawClause, mRangeStyle={ mLineStyle=LineStyle::Solid, IsUnderlineColorDefined=false, mForegroundColor={ R=0xFC, G=0xFC, B=0xFC, A=0xFF }, mBackgroundColor={ R=0x3D, G=0xAE, B=0xE9, A=0xFF } } } W/IMEHandler 0x7f07dc4455e0 SetTextRange(), FAILED, due to current clause length is 0 D/IMEHandler 0x7f07dc4455e0 CreateTextRangeArray(), mStartOffset=1, mEndOffset=1, mRangeType=TextRangeType::eCaret I/IMEHandler 0x7f07dc4455e0 OnRetrieveSurroundingNative(aContext=0x7f07c78fa170), current context=0x7f07c78fa170 I/IMEHandler 0x7f07dc4455e0 GetCurrentParagraph(), mCompositionState=CompositionChangeEventDispatched D/IMEHandler 0x7f07dc4455e0 GetCurrentParagraph(), selOffset=1, selLength=0 D/IMEHandler 0x7f07dc4455e0 GetCurrentParagraph(), succeeded, aText=낭, aText.Length()=1, aCursorPos=1 I/IMEHandler 0x7f07dc4455e0 OnSelectionChange(aCaller=0x7f07bfea3c00, aIMENotification={ mSelectionChangeData={ mOffset=2, mString="" (Length()=0), GetWritingMode()=h-ltr, mReversed=false, mCausedByComposition=true, mCausedBySelectionEvent=false, mOccurredDuringComposition=true } }), mCompositionState=CompositionChangeEventDispatched, mIsDeletingSurrounding=false, mRetrieveSurroundingSignalReceived=true, isSelectionRangeChanged=true I/IMEHandler 0x7f07dc4455e0 SetCursorPosition(aContext=0x7f07c78fa170), mCompositionTargetRange={ mOffset=1, mLength=4294967295 }, mContentSelection={ HasRange()=false } I/IMEHandler 0x7f07dc4455e0 SetCursorPosition(aContext=0x7f07c78fa170), mCompositionTargetRange={ mOffset=1, mLength=4294967295 }, mContentSelection={ HasRange()=false } I/IMEHandler >>>>>>>>>>>>>>>> ``` When you type the second Hangul character, it exists as a composing character. ``` I/IMEHandler 0x7f07dc4455e0 OnKeyEvent(aCaller=0x7f07bfea3c00, aEvent(0x7f078a99c020): { type=GDK_KEY_RELEASE, keyval=m, unicode=0x6D, state=, time=5542080, hardware_keycode=58, group=0 }, aKeyboardEventWasDispatched=false) I/IMEHandler 0x7f07dc4455e0 OnKeyEvent(), mMaybeInDeadKeySequence=false, mCompositionState=CompositionChangeEventDispatched, current context=7f07c78fa170, active context=7f07c78fa170, mIMContextID=Fcitx, mIsIMInAsyncKeyHandlingMode=true <snip> D/IMEHandler 0x7f07dc4455e0 OnKeyEvent(), succeeded, filterThisEvent=false (isFiltered=false, mFallbackToKeyEvent=false, probablyHandledAsynchronously=true, maybeHandledAsynchronously=false), mPostingKeyEvents.Length()=0, mCompositionState=CompositionChangeEventDispatched, mMaybeInDeadKeySequence=false, mKeyboardEventWasDispatched=false, mKeyboardEventWasConsumed=false I/IMEHandler <<<<<<<<<<<<<<<< I/IMEHandler >>>>>>>>>>>>>>>> I/IMEHandler 0x7f07dc4455e0 OnKeyEvent(aCaller=0x7f07bfea3c00, aEvent(0x7f078a99c020): { type=GDK_KEY_RELEASE, keyval=l, unicode=0x6C, state=, time=5542144, hardware_keycode=46, group=0 }, aKeyboardEventWasDispatched=false) I/IMEHandler 0x7f07dc4455e0 OnKeyEvent(), mMaybeInDeadKeySequence=false, mCompositionState=CompositionChangeEventDispatched, current context=7f07c78fa170, active context=7f07c78fa170, mIMContextID=Fcitx, mIsIMInAsyncKeyHandlingMode=true ``` Then, you release `m` and `l` keys, and Fcitx5 or the conversion engine queries current paragraph, however, the second character has not been handled in the remote process yet. ``` I/IMEHandler 0x7f07dc4455e0 OnRetrieveSurroundingNative(aContext=0x7f07c78fa170), current context=0x7f07c78fa170 I/IMEHandler 0x7f07dc4455e0 GetCurrentParagraph(), mCompositionState=CompositionChangeEventDispatched D/IMEHandler 0x7f07dc4455e0 GetCurrentParagraph(), selOffset=1, selLength=0 D/IMEHandler 0x7f07dc4455e0 GetCurrentParagraph(), succeeded, aText=나, aText.Length()=1, aCursorPos=1 D/IMEHandler 0x7f07dc4455e0 OnKeyEvent(), succeeded, filterThisEvent=false (isFiltered=false, mFallbackToKeyEvent=false, probablyHandledAsynchronously=true, maybeHandledAsynchronously=false), mPostingKeyEvents.Length()=0, mCompositionState=CompositionChangeEventDispatched, mMaybeInDeadKeySequence=false, mKeyboardEventWasDispatched=false, mKeyboardEventWasConsumed=false I/IMEHandler <<<<<<<<<<<<<<<< I/IMEHandler 0x7f07dc4455e0 SetCursorPosition(aContext=0x7f07c78fa170), mCompositionTargetRange={ mOffset=1, mLength=4294967295 }, mContentSelection={ HasRange()=false } ``` Then, selection is modified by Fcitx5 or the conversion engine to end of handled text by the remote process. ``` I/IMEHandler >>>>>>>>>>>>>>>> I/IMEHandler 0x7f07dc4455e0 OnKeyEvent(aCaller=0x7f07bfea3c00, aEvent(0x7f078a99cd40): { type=GDK_KEY_PRESS, keyval=space, unicode=0x20, state=, time=5542432, hardware_keycode=65, group=0 }, aKeyboardEventWasDispatched=false) I/IMEHandler 0x7f07dc4455e0 OnKeyEvent(), mMaybeInDeadKeySequence=false, mCompositionState=CompositionChangeEventDispatched, current context=7f07c78fa170, active context=7f07c78fa170, mIMContextID=Fcitx, mIsIMInAsyncKeyHandlingMode=true I/IMEHandler 0x7f07dc4455e0 OnRetrieveSurroundingNative(aContext=0x7f07c78fa170), current context=0x7f07c78fa170 I/IMEHandler 0x7f07dc4455e0 GetCurrentParagraph(), mCompositionState=CompositionChangeEventDispatched D/IMEHandler 0x7f07dc4455e0 GetCurrentParagraph(), selOffset=1, selLength=0 D/IMEHandler 0x7f07dc4455e0 GetCurrentParagraph(), succeeded, aText=나, aText.Length()=1, aCursorPos=1 I/IMEHandler 0x7f07dc4455e0 OnCommitCompositionNative(aContext=0x7f07c78fa170), current context=0x7f07c78fa170, active context=0x7f07c78fa170, commitString=" ", mProcessingKeyEvent=0x7f078a99cd40, IsComposingOn(aContext)=true I/IMEHandler 0x7f07dc4455e0 DispatchCompositionCommitEvent(aContext=0x7f07c78fa170, aCommitString=0x7ffd0194d470, (" ")) I/IMEHandler 0x7f07dc4455e0 MaybeDispatchKeyEventAsProcessedByIME(aFollowingEvent=eCompositionCommit), dispatch eKeyDown processing event: { type=GDK_KEY_PRESS, keyval=space, unicode=0x20, state=FcitxKeyState_IgnoredMask, time=5542432, hardware_keycode=65, group=0 } I/IMEHandler 0x7f07dc4455e0 MaybeDispatchKeyEventAsProcessedByIME(), keydown or keyup event is dispatched D/IMEHandler 0x7f07dc4455e0 OnKeyEvent(), succeeded, filterThisEvent=true (isFiltered=true, mFallbackToKeyEvent=false, probablyHandledAsynchronously=true, maybeHandledAsynchronously=false), mPostingKeyEvents.Length()=0, mCompositionState=NotComposing, mMaybeInDeadKeySequence=false, mKeyboardEventWasDispatched=true, mKeyboardEventWasConsumed=false I/IMEHandler <<<<<<<<<<<<<<<< ``` Then, you typed space and it's handled before committing the preceding composition! ``` I/IMEHandler 0x7f07dc4455e0 OnCommitCompositionNative(aContext=0x7f07c78fa170), current context=0x7f07c78fa170, active context=0x7f07c78fa170, commitString="의", mProcessingKeyEvent=0x0, IsComposingOn(aContext)=false ``` Then, Fcitx5 sends commit event for the preceding composition... I guess that this odd order is a bug of Fcitx5 or the conversion engine, but it's caused by returning unexpected surrounding text which does not contain the composing string.
Bug 1772749 Comment 5 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
Thank you for attaching the log. ``` I/IMEHandler 0x7f07dc4455e0 OnChangeCompositionNative(aContext=0x7f07c78fa170), mComposingContext=0x7f07c78fa170 I/IMEHandler 0x7f07dc4455e0 GetCompositionString(aContext=0x7f07c78fa170), aCompositionString="의" I/IMEHandler 0x7f07dc4455e0 DispatchCompositionChangeEvent(aContext=0x7f07c78fa170) I/IMEHandler 0x7f07dc4455e0 CreateTextRangeArray(aContext=0x7f07c78fa170, aCompositionString="의" (Length()=1)) D/IMEHandler 0x7f07dc4455e0 SetTextRange(), succeeded, aTextRange= { mStartOffset=0, mEndOffset=1, mRangeType=TextRangeType::eRawClause, mRangeStyle={ mLineStyle=LineStyle::Solid, IsUnderlineColorDefined=false, mForegroundColor={ R=0xFC, G=0xFC, B=0xFC, A=0xFF }, mBackgroundColor={ R=0x3D, G=0xAE, B=0xE9, A=0xFF } } } W/IMEHandler 0x7f07dc4455e0 SetTextRange(), FAILED, due to current clause length is 0 D/IMEHandler 0x7f07dc4455e0 CreateTextRangeArray(), mStartOffset=1, mEndOffset=1, mRangeType=TextRangeType::eCaret I/IMEHandler 0x7f07dc4455e0 OnRetrieveSurroundingNative(aContext=0x7f07c78fa170), current context=0x7f07c78fa170 I/IMEHandler 0x7f07dc4455e0 GetCurrentParagraph(), mCompositionState=CompositionChangeEventDispatched D/IMEHandler 0x7f07dc4455e0 GetCurrentParagraph(), selOffset=1, selLength=0 D/IMEHandler 0x7f07dc4455e0 GetCurrentParagraph(), succeeded, aText=낭, aText.Length()=1, aCursorPos=1 I/IMEHandler 0x7f07dc4455e0 OnSelectionChange(aCaller=0x7f07bfea3c00, aIMENotification={ mSelectionChangeData={ mOffset=2, mString="" (Length()=0), GetWritingMode()=h-ltr, mReversed=false, mCausedByComposition=true, mCausedBySelectionEvent=false, mOccurredDuringComposition=true } }), mCompositionState=CompositionChangeEventDispatched, mIsDeletingSurrounding=false, mRetrieveSurroundingSignalReceived=true, isSelectionRangeChanged=true I/IMEHandler 0x7f07dc4455e0 SetCursorPosition(aContext=0x7f07c78fa170), mCompositionTargetRange={ mOffset=1, mLength=4294967295 }, mContentSelection={ HasRange()=false } I/IMEHandler 0x7f07dc4455e0 SetCursorPosition(aContext=0x7f07c78fa170), mCompositionTargetRange={ mOffset=1, mLength=4294967295 }, mContentSelection={ HasRange()=false } I/IMEHandler >>>>>>>>>>>>>>>> ``` When you type the second Hangul character, it exists as a composing character. (Oh, bu the first character is different from `나`, why...?) ``` I/IMEHandler 0x7f07dc4455e0 OnKeyEvent(aCaller=0x7f07bfea3c00, aEvent(0x7f078a99c020): { type=GDK_KEY_RELEASE, keyval=m, unicode=0x6D, state=, time=5542080, hardware_keycode=58, group=0 }, aKeyboardEventWasDispatched=false) I/IMEHandler 0x7f07dc4455e0 OnKeyEvent(), mMaybeInDeadKeySequence=false, mCompositionState=CompositionChangeEventDispatched, current context=7f07c78fa170, active context=7f07c78fa170, mIMContextID=Fcitx, mIsIMInAsyncKeyHandlingMode=true <snip> D/IMEHandler 0x7f07dc4455e0 OnKeyEvent(), succeeded, filterThisEvent=false (isFiltered=false, mFallbackToKeyEvent=false, probablyHandledAsynchronously=true, maybeHandledAsynchronously=false), mPostingKeyEvents.Length()=0, mCompositionState=CompositionChangeEventDispatched, mMaybeInDeadKeySequence=false, mKeyboardEventWasDispatched=false, mKeyboardEventWasConsumed=false I/IMEHandler <<<<<<<<<<<<<<<< I/IMEHandler >>>>>>>>>>>>>>>> I/IMEHandler 0x7f07dc4455e0 OnKeyEvent(aCaller=0x7f07bfea3c00, aEvent(0x7f078a99c020): { type=GDK_KEY_RELEASE, keyval=l, unicode=0x6C, state=, time=5542144, hardware_keycode=46, group=0 }, aKeyboardEventWasDispatched=false) I/IMEHandler 0x7f07dc4455e0 OnKeyEvent(), mMaybeInDeadKeySequence=false, mCompositionState=CompositionChangeEventDispatched, current context=7f07c78fa170, active context=7f07c78fa170, mIMContextID=Fcitx, mIsIMInAsyncKeyHandlingMode=true ``` Then, you release `m` and `l` keys, and Fcitx5 or the conversion engine queries current paragraph, however, the second character has not been handled in the remote process yet. ``` I/IMEHandler 0x7f07dc4455e0 OnRetrieveSurroundingNative(aContext=0x7f07c78fa170), current context=0x7f07c78fa170 I/IMEHandler 0x7f07dc4455e0 GetCurrentParagraph(), mCompositionState=CompositionChangeEventDispatched D/IMEHandler 0x7f07dc4455e0 GetCurrentParagraph(), selOffset=1, selLength=0 D/IMEHandler 0x7f07dc4455e0 GetCurrentParagraph(), succeeded, aText=나, aText.Length()=1, aCursorPos=1 D/IMEHandler 0x7f07dc4455e0 OnKeyEvent(), succeeded, filterThisEvent=false (isFiltered=false, mFallbackToKeyEvent=false, probablyHandledAsynchronously=true, maybeHandledAsynchronously=false), mPostingKeyEvents.Length()=0, mCompositionState=CompositionChangeEventDispatched, mMaybeInDeadKeySequence=false, mKeyboardEventWasDispatched=false, mKeyboardEventWasConsumed=false I/IMEHandler <<<<<<<<<<<<<<<< I/IMEHandler 0x7f07dc4455e0 SetCursorPosition(aContext=0x7f07c78fa170), mCompositionTargetRange={ mOffset=1, mLength=4294967295 }, mContentSelection={ HasRange()=false } ``` Then, selection is modified by ~~Fcitx5 or the conversion engine~~ __us__ to end of handled text by the remote process. ``` I/IMEHandler >>>>>>>>>>>>>>>> I/IMEHandler 0x7f07dc4455e0 OnKeyEvent(aCaller=0x7f07bfea3c00, aEvent(0x7f078a99cd40): { type=GDK_KEY_PRESS, keyval=space, unicode=0x20, state=, time=5542432, hardware_keycode=65, group=0 }, aKeyboardEventWasDispatched=false) I/IMEHandler 0x7f07dc4455e0 OnKeyEvent(), mMaybeInDeadKeySequence=false, mCompositionState=CompositionChangeEventDispatched, current context=7f07c78fa170, active context=7f07c78fa170, mIMContextID=Fcitx, mIsIMInAsyncKeyHandlingMode=true I/IMEHandler 0x7f07dc4455e0 OnRetrieveSurroundingNative(aContext=0x7f07c78fa170), current context=0x7f07c78fa170 I/IMEHandler 0x7f07dc4455e0 GetCurrentParagraph(), mCompositionState=CompositionChangeEventDispatched D/IMEHandler 0x7f07dc4455e0 GetCurrentParagraph(), selOffset=1, selLength=0 D/IMEHandler 0x7f07dc4455e0 GetCurrentParagraph(), succeeded, aText=나, aText.Length()=1, aCursorPos=1 I/IMEHandler 0x7f07dc4455e0 OnCommitCompositionNative(aContext=0x7f07c78fa170), current context=0x7f07c78fa170, active context=0x7f07c78fa170, commitString=" ", mProcessingKeyEvent=0x7f078a99cd40, IsComposingOn(aContext)=true I/IMEHandler 0x7f07dc4455e0 DispatchCompositionCommitEvent(aContext=0x7f07c78fa170, aCommitString=0x7ffd0194d470, (" ")) I/IMEHandler 0x7f07dc4455e0 MaybeDispatchKeyEventAsProcessedByIME(aFollowingEvent=eCompositionCommit), dispatch eKeyDown processing event: { type=GDK_KEY_PRESS, keyval=space, unicode=0x20, state=FcitxKeyState_IgnoredMask, time=5542432, hardware_keycode=65, group=0 } I/IMEHandler 0x7f07dc4455e0 MaybeDispatchKeyEventAsProcessedByIME(), keydown or keyup event is dispatched D/IMEHandler 0x7f07dc4455e0 OnKeyEvent(), succeeded, filterThisEvent=true (isFiltered=true, mFallbackToKeyEvent=false, probablyHandledAsynchronously=true, maybeHandledAsynchronously=false), mPostingKeyEvents.Length()=0, mCompositionState=NotComposing, mMaybeInDeadKeySequence=false, mKeyboardEventWasDispatched=true, mKeyboardEventWasConsumed=false I/IMEHandler <<<<<<<<<<<<<<<< ``` Then, you typed space and it's handled before committing the preceding composition! ``` I/IMEHandler 0x7f07dc4455e0 OnCommitCompositionNative(aContext=0x7f07c78fa170), current context=0x7f07c78fa170, active context=0x7f07c78fa170, commitString="의", mProcessingKeyEvent=0x0, IsComposingOn(aContext)=false ``` Then, Fcitx5 sends commit event for the preceding composition... I guess that this odd order is a bug of Fcitx5 or the conversion engine, but it's caused by returning unexpected surrounding text which does not contain the composing string.