mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 10:00:54 +00:00
Bug 813602 - Don't perform IME sync when there is no focus; r=cpeterson
This commit is contained in:
parent
7c54cbb8fa
commit
1329c17777
@ -80,6 +80,7 @@ final class GeckoEditable
|
||||
private int mUIUpdateSeqno;
|
||||
private int mLastUIUpdateSeqno;
|
||||
private boolean mUpdateGecko;
|
||||
private boolean mFocused;
|
||||
|
||||
/* An action that alters the Editable
|
||||
|
||||
@ -224,7 +225,7 @@ final class GeckoEditable
|
||||
if (DEBUG) {
|
||||
GeckoApp.assertOnUiThread();
|
||||
}
|
||||
if (!mActions.isEmpty()) {
|
||||
if (mFocused && !mActions.isEmpty()) {
|
||||
mActionsActive.acquireUninterruptibly();
|
||||
mActionsActive.release();
|
||||
}
|
||||
@ -477,10 +478,15 @@ final class GeckoEditable
|
||||
public void run() {
|
||||
// Make sure there are no other things going on
|
||||
mActionQueue.syncWithGecko();
|
||||
if (type == NOTIFY_IME_FOCUSCHANGE && state != IME_FOCUS_STATE_BLUR) {
|
||||
// Unmask events on the Gecko side
|
||||
GeckoAppShell.sendEventToGecko(GeckoEvent.createIMEEvent(
|
||||
GeckoEvent.IME_ACKNOWLEDGE_FOCUS));
|
||||
if (type == NOTIFY_IME_FOCUSCHANGE) {
|
||||
if (state == IME_FOCUS_STATE_BLUR) {
|
||||
mFocused = false;
|
||||
} else {
|
||||
mFocused = true;
|
||||
// Unmask events on the Gecko side
|
||||
GeckoAppShell.sendEventToGecko(GeckoEvent.createIMEEvent(
|
||||
GeckoEvent.IME_ACKNOWLEDGE_FOCUS));
|
||||
}
|
||||
}
|
||||
if (mListener != null) {
|
||||
mListener.notifyIME(type, state);
|
||||
@ -656,9 +662,11 @@ final class GeckoEditable
|
||||
what == Selection.SELECTION_END) {
|
||||
Log.w(LOGTAG, "selection removed with removeSpan()");
|
||||
}
|
||||
// Okay to remove immediately
|
||||
mText.removeSpan(what);
|
||||
mActionQueue.offer(new Action(Action.TYPE_REMOVE_SPAN));
|
||||
if (mText.getSpanStart(what) >= 0) { // only remove if it's there
|
||||
// Okay to remove immediately
|
||||
mText.removeSpan(what);
|
||||
mActionQueue.offer(new Action(Action.TYPE_REMOVE_SPAN));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user