=== modified file 'src/view/abstracttexteditor.cpp' --- src/view/abstracttexteditor.cpp 2016-04-27 23:37:27 +0000 +++ src/view/abstracttexteditor.cpp 2016-06-14 15:13:53 +0000 @@ -428,7 +428,7 @@ d->word_engine->computeCandidates(d->text.data()); } - if (!d->word_engine->languageFeature()->showPrimaryInPreedit()) { + if (!d->word_engine->languageFeature()->showPrimaryInPreedit() && d->preedit_enabled) { sendPreeditString(d->text->preedit(), d->text->preeditFace(), Replacement(d->text->cursorPosition())); } @@ -535,10 +535,8 @@ if (d->word_engine->languageFeature()->commitOnSpace() || full_stop_inserted) { commitPreedit(); - } else { - if (d->preedit_enabled) { - d->word_engine->computeCandidates(d->text.data()); - } + } else if (d->preedit_enabled) { + d->word_engine->computeCandidates(d->text.data()); sendPreeditString(d->text->preedit(), d->text->preeditFace(), Replacement(d->text->cursorPosition())); === modified file 'tests/autopilot/ubuntu_keyboard/tests/test_keyboard.py' --- tests/autopilot/ubuntu_keyboard/tests/test_keyboard.py 2016-04-28 00:42:26 +0000 +++ tests/autopilot/ubuntu_keyboard/tests/test_keyboard.py 2016-06-14 15:13:53 +0000 @@ -1359,6 +1359,55 @@ Eventually(Equals(False)) ) + def test_double_caps(self): + """Ensure that we switch back to lowercase after typing a letter in + Oxide. + + """ + qml = dedent(""" + import QtQuick 2.4 + import Ubuntu.Components 1.3 + import Ubuntu.Web 0.2 + + Rectangle { + id: window + objectName: "windowRectangle" + color: "lightgrey" + + WebView { + anchors.fill: parent + objectName: "webview" + Component.onCompleted: { + loadHtml(" + + " + ); + } + } + } + + """) + gsettings = Gio.Settings.new("com.canonical.keyboard.maliit") + gsettings.set_boolean("auto-capitalization", True) + gsettings.set_boolean("auto-completion", False) + gsettings.set_boolean("predictive-text", False) + gsettings.set_boolean("spell-checking", False) + + app = self._start_qml_script(qml) + webview = app.select_single(objectName='webview') + + self.ensure_focus_on_input(webview) + keyboard = Keyboard() + self.addCleanup(keyboard.dismiss) + + keyboard.type('H') + + self.assertThat( + keyboard.active_keypad_state, + Eventually(Equals(KeyPadState.NORMAL)) + ) + class UbuntuKeyboardPluginPaths(UbuntuKeyboardTests):