Merge lp:~sil2100/ubuntu-keyboard/preedit_state_fix into lp:ubuntu-keyboard

Proposed by Łukasz Zemczak
Status: Superseded
Proposed branch: lp:~sil2100/ubuntu-keyboard/preedit_state_fix
Merge into: lp:ubuntu-keyboard
Diff against target: 33 lines (+12/-1)
1 file modified
src/view/abstracttexteditor.cpp (+12/-1)
To merge this branch: bzr merge lp:~sil2100/ubuntu-keyboard/preedit_state_fix
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Ubuntu Phablet Team Pending
Review via email: mp+207878@code.launchpad.net

This proposal has been superseded by a proposal from 2014-03-12.

Commit message

Clear the candidate list on empty preedit, fix the inputMethodComposing state reported by ubuntu-keyboard

Description of the change

Ok, this should be ready for review finally.

Clear the candidate list on empty preedit

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Bill Filler (bfiller) wrote :

This branch had some problems. While it did fix the issue on the backspace, it didn't solve the problem where the previous uncommited word and word candidates were showing up when you refocused the field. That should be solved now with my branch and the messaging-app branch.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/view/abstracttexteditor.cpp'
--- src/view/abstracttexteditor.cpp 2013-11-21 13:26:12 +0000
+++ src/view/abstracttexteditor.cpp 2014-03-06 09:41:46 +0000
@@ -433,7 +433,7 @@
433 case Key::ActionSpace: {433 case Key::ActionSpace: {
434 QString textOnLeft = d->text->surroundingLeft() + d->text->preedit();434 QString textOnLeft = d->text->surroundingLeft() + d->text->preedit();
435 const bool auto_caps_activated = d->word_engine->languageFeature()->activateAutoCaps(textOnLeft);435 const bool auto_caps_activated = d->word_engine->languageFeature()->activateAutoCaps(textOnLeft);
436 const bool replace_preedit = d->auto_correct_enabled && not d->text->primaryCandidate().isEmpty();436 const bool replace_preedit = d->auto_correct_enabled && not d->text->primaryCandidate().isEmpty() && not d->text->preedit().isEmpty();
437437
438 if (replace_preedit) {438 if (replace_preedit) {
439 const QString &appendix = d->word_engine->languageFeature()->appendixForReplacedPreedit(d->text->preedit());439 const QString &appendix = d->word_engine->languageFeature()->appendixForReplacedPreedit(d->text->preedit());
@@ -756,9 +756,20 @@
756 sendKeyEvent(ev);756 sendKeyEvent(ev);
757 } else {757 } else {
758 d->text->removeFromPreedit(1);758 d->text->removeFromPreedit(1);
759
759 d->word_engine->computeCandidates(d->text.data());760 d->word_engine->computeCandidates(d->text.data());
760 sendPreeditString(d->text->preedit(), d->text->preeditFace(),761 sendPreeditString(d->text->preedit(), d->text->preeditFace(),
761 Replacement());762 Replacement());
763
764 if (d->text->preedit().isEmpty()) {
765 d->word_engine->clearCandidates();
766 d->text->commitPreedit();
767 // XXX: This is something like a workaround for maliit reporting an invalid state to Qt.
768 // When preedit is cleared, for Qt not reporting it as inputMethodComposing all the time we need
769 // to flush out all the TextFormat attributes - so we actually need to commit anything for that
770 // to happen
771 sendCommitString("");
772 }
762 }773 }
763774
764 d->backspace_sent = true;775 d->backspace_sent = true;

Subscribers

People subscribed via source and target branches