Bug 635857 - nsWindow::ResetInputState() commits duplicated composition string. r=mwu a=blocking-fennec

This commit is contained in:
Makoto Kato 2011-03-08 12:24:31 +09:00
Родитель bd154c1c14
Коммит 88b81c8eca
2 изменённых файлов: 18 добавлений и 4 удалений

Просмотреть файл

@ -428,8 +428,24 @@ public class GeckoAppShell
switch (type) {
case NOTIFY_IME_RESETINPUTSTATE:
GeckoApp.surfaceView.inputConnection.finishComposingText();
IMEStateUpdater.resetIME();
// Composition event is already fired from widget.
// So reset IME flags.
GeckoApp.surfaceView.inputConnection.reset();
// Don't use IMEStateUpdater for reset.
// Because IME may not work showSoftInput()
// after calling restartInput() immediately.
// So we have to call showSoftInput() delay.
InputMethodManager imm = (InputMethodManager)
GeckoApp.surfaceView.getContext().getSystemService(
Context.INPUT_METHOD_SERVICE);
if (imm == null) {
// no way to reset IME status directly
IMEStateUpdater.resetIME();
} else {
imm.restartInput(GeckoApp.surfaceView);
}
// keep current enabled state
IMEStateUpdater.enableIME();
break;
@ -439,7 +455,6 @@ public class GeckoAppShell
break;
case NOTIFY_IME_FOCUSCHANGE:
GeckoApp.surfaceView.mIMEFocus = state != 0;
IMEStateUpdater.resetIME();
break;
}

Просмотреть файл

@ -582,7 +582,6 @@ class GeckoSurfaceView
KeyListener mKeyListener;
Editable mEditable;
Editable.Factory mEditableFactory;
boolean mIMEFocus;
int mIMEState;
String mIMETypeHint;
String mIMEActionHint;