Skip to content

Commit

Permalink
Merge pull request #37 from sailfishos/jb56870
Browse files Browse the repository at this point in the history
[qtmozembed] Fix text input with xt9. JB#56870
  • Loading branch information
mkenttala committed Jan 18, 2022
2 parents 6c64fdf + fb90d55 commit e781135
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/qmozview_p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,6 @@ void QMozViewPrivate::inputMethodEvent(QInputMethodEvent *event)
<< ", replSt:" << event->replacementStart();
#endif

mPreedit = !event->preeditString().isEmpty();
if (mViewInitialized) {
uint16_t charCode = (event->commitString().size() == 1 && event->commitString()[0].isPrint())
? (int32_t)event->commitString()[0].unicode()
Expand All @@ -671,14 +670,15 @@ void QMozViewPrivate::inputMethodEvent(QInputMethodEvent *event)
qGuiApp->inputMethod()->reset();

} else {
if (event->commitString().isEmpty() || event->commitString().size() > 1) {
if (mPreedit || event->commitString().isEmpty() || event->commitString().size() > 1) {
mView->SendTextEvent(event->commitString().toUtf8().data(), event->preeditString().toUtf8().data(), event->replacementStart(), event->replacementLength());
} else {
mView->SendKeyPress(0, 0, charCode);
mView->SendKeyRelease(0, 0, charCode);
}
}
}
mPreedit = !event->preeditString().isEmpty();
}

void QMozViewPrivate::keyPressEvent(QKeyEvent *event)
Expand Down

0 comments on commit e781135

Please sign in to comment.