summaryrefslogtreecommitdiffstats
path: root/src/android/jar
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>2013-11-14 12:09:19 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-14 21:15:35 +0100
commit20981e2953adc8ad64735806e8564fc258d21900 (patch)
tree6dd6934d91240848565d94be00f1d6323c0aa991 /src/android/jar
parent6128f4efb42dec892ce057d92832adc820114c60 (diff)
REG: Fix changing input method parameters on Android
After b7440536c788b04861591187edd071bf2c2ec137, we no longer restart the input method when the keyboard is shown, even if the parameters for the input method has changed. The effect was that if you had opened a keyboard with, say, digits only, then all keyboards would be digits only forever, regardless of the settings on text input. This patch tries to be conservative, so it only adds back the restartInput() logic when any of parameters have actually been changed. Tested the code the original patch was made to fix and it still works as before. Task-number: QTBUG-34827 Change-Id: Icaee6026d5c3e95b605bb76485acf4fd651f81bd Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com> Reviewed-by: BogDan Vatra <bogdan@kde.org>
Diffstat (limited to 'src/android/jar')
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java5
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtEditText.java10
2 files changed, 15 insertions, 0 deletions
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
index da2f6163ea..3dcffeb07d 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
@@ -192,6 +192,7 @@ public class QtActivityDelegate
@Override
public void run() {
m_imm.restartInput(m_editText);
+ m_editText.m_optionsChanged = false;
}
}, 5);
}
@@ -279,6 +280,10 @@ public class QtActivityDelegate
}
}
});
+ if (m_editText.m_optionsChanged) {
+ m_imm.restartInput(m_editText);
+ m_editText.m_optionsChanged = false;
+ }
}
}, 15);
}
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtEditText.java b/src/android/jar/src/org/qtproject/qt5/android/QtEditText.java
index 7e3ebb539a..593746aac9 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtEditText.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtEditText.java
@@ -53,22 +53,32 @@ public class QtEditText extends View
int m_initialCapsMode = 0;
int m_imeOptions = 0;
int m_inputType = InputType.TYPE_CLASS_TEXT;
+ boolean m_optionsChanged = false;
QtActivityDelegate m_activityDelegate;
public void setImeOptions(int m_imeOptions)
{
+ if (m_imeOptions == this.m_imeOptions)
+ return;
this.m_imeOptions = m_imeOptions;
+ m_optionsChanged = true;
}
public void setInitialCapsMode(int m_initialCapsMode)
{
+ if (m_initialCapsMode == this.m_initialCapsMode)
+ return;
this.m_initialCapsMode = m_initialCapsMode;
+ m_optionsChanged = true;
}
public void setInputType(int m_inputType)
{
+ if (m_inputType == this.m_inputType)
+ return;
this.m_inputType = m_inputType;
+ m_optionsChanged = true;
}
public QtEditText(Context context, QtActivityDelegate activityDelegate)