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
1=== modified file 'src/view/abstracttexteditor.cpp'
2--- src/view/abstracttexteditor.cpp 2013-11-21 13:26:12 +0000
3+++ src/view/abstracttexteditor.cpp 2014-03-06 09:41:46 +0000
4@@ -433,7 +433,7 @@
5 case Key::ActionSpace: {
6 QString textOnLeft = d->text->surroundingLeft() + d->text->preedit();
7 const bool auto_caps_activated = d->word_engine->languageFeature()->activateAutoCaps(textOnLeft);
8- const bool replace_preedit = d->auto_correct_enabled && not d->text->primaryCandidate().isEmpty();
9+ const bool replace_preedit = d->auto_correct_enabled && not d->text->primaryCandidate().isEmpty() && not d->text->preedit().isEmpty();
10
11 if (replace_preedit) {
12 const QString &appendix = d->word_engine->languageFeature()->appendixForReplacedPreedit(d->text->preedit());
13@@ -756,9 +756,20 @@
14 sendKeyEvent(ev);
15 } else {
16 d->text->removeFromPreedit(1);
17+
18 d->word_engine->computeCandidates(d->text.data());
19 sendPreeditString(d->text->preedit(), d->text->preeditFace(),
20 Replacement());
21+
22+ if (d->text->preedit().isEmpty()) {
23+ d->word_engine->clearCandidates();
24+ d->text->commitPreedit();
25+ // XXX: This is something like a workaround for maliit reporting an invalid state to Qt.
26+ // When preedit is cleared, for Qt not reporting it as inputMethodComposing all the time we need
27+ // to flush out all the TextFormat attributes - so we actually need to commit anything for that
28+ // to happen
29+ sendCommitString("");
30+ }
31 }
32
33 d->backspace_sent = true;

Subscribers

People subscribed via source and target branches