diff --git a/widget/gtk/IMContextWrapper.cpp b/widget/gtk/IMContextWrapper.cpp index c15e962e66bb..6391e4c24696 100644 --- a/widget/gtk/IMContextWrapper.cpp +++ b/widget/gtk/IMContextWrapper.cpp @@ -2372,8 +2372,7 @@ bool IMContextWrapper::DispatchCompositionCommitEvent( // shouldn't reset IME because the trigger of causing this commit may be an // input for next composition and we shouldn't cancel it. if (mSelection.IsValid()) { - mSelection.CollapseTo(mSelection.mOffset + aCommitString->Length(), - mSelection.mWritingMode); + mSelection.CollapseTo(mSelection.mOffset + aCommitString->Length()); MOZ_LOG(gIMELog, LogLevel::Info, ("0x%p DispatchCompositionCommitEvent(), " "mSelection={ mOffset=%u, mString=\"%s\", mWritingMode=%s }", @@ -2423,11 +2422,10 @@ bool IMContextWrapper::DispatchCompositionCommitEvent( } // Emulate selection until receiving actual selection range. - mSelection.CollapseTo( - mCompositionStart + (aCommitString - ? aCommitString->Length() - : mDispatchedCompositionString.Length()), - mSelection.mWritingMode); + mSelection.CollapseTo(mCompositionStart + + (aCommitString + ? aCommitString->Length() + : mDispatchedCompositionString.Length())); } mCompositionState = eCompositionState_NotComposing; diff --git a/widget/gtk/IMContextWrapper.h b/widget/gtk/IMContextWrapper.h index 9ebb22fc3dab..7e8e678fe16d 100644 --- a/widget/gtk/IMContextWrapper.h +++ b/widget/gtk/IMContextWrapper.h @@ -393,8 +393,7 @@ class IMContextWrapper final : public TextEventDispatcherListener { mOffset = UINT32_MAX; mWritingMode = WritingMode(); } - void CollapseTo(uint32_t aOffset, const WritingMode& aWritingMode) { - mWritingMode = aWritingMode; + void CollapseTo(uint32_t aOffset) { mOffset = aOffset; mString.Truncate(); }