REG: Fix changing input method parameters on Android

After b7440536c7, 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>
bb10
Eskil Abrahamsen Blomfeldt 2013-11-14 12:09:19 +01:00 committed by The Qt Project
parent 6128f4efb4
commit 20981e2953
2 changed files with 15 additions and 0 deletions

View File

@ -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);
}

View File

@ -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)