mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 831862 - Force restart input during notifyIMEEnabled; r=cpeterson
This commit is contained in:
parent
816905dd21
commit
d3b8ad4552
@ -200,14 +200,18 @@ class GeckoInputConnection
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void restartInput() {
|
private void tryRestartInput() {
|
||||||
// Coalesce restartInput calls because InputMethodManager.restartInput()
|
// Coalesce restartInput calls because InputMethodManager.restartInput()
|
||||||
// is expensive and successive calls to it can lock up the keyboard
|
// is expensive and successive calls to it can lock up the keyboard
|
||||||
long time = SystemClock.uptimeMillis();
|
if (SystemClock.uptimeMillis() < mLastRestartInputTime + 200) {
|
||||||
if (time < mLastRestartInputTime + 200) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mLastRestartInputTime = time;
|
restartInput();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void restartInput() {
|
||||||
|
|
||||||
|
mLastRestartInputTime = SystemClock.uptimeMillis();
|
||||||
|
|
||||||
final InputMethodManager imm = getInputMethodManager();
|
final InputMethodManager imm = getInputMethodManager();
|
||||||
if (imm == null) {
|
if (imm == null) {
|
||||||
@ -515,7 +519,7 @@ class GeckoInputConnection
|
|||||||
case NOTIFY_IME_RESETINPUTSTATE:
|
case NOTIFY_IME_RESETINPUTSTATE:
|
||||||
// Commit and end composition
|
// Commit and end composition
|
||||||
finishComposingText();
|
finishComposingText();
|
||||||
restartInput();
|
tryRestartInput();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NOTIFY_IME_FOCUSCHANGE:
|
case NOTIFY_IME_FOCUSCHANGE:
|
||||||
|
Loading…
Reference in New Issue
Block a user