mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-15 14:25:52 +00:00
Bug 989046 - f. Only unregister event in GeckoEditable if already registered; r=capella
This commit is contained in:
parent
11d4068752
commit
4f6e8707c8
@ -103,7 +103,8 @@ final class GeckoEditable
|
||||
private int mIcUpdateSeqno;
|
||||
private int mLastIcUpdateSeqno;
|
||||
private boolean mUpdateGecko;
|
||||
private boolean mFocused;
|
||||
private boolean mFocused; // Used by IC thread
|
||||
private boolean mGeckoFocused; // Used by Gecko thread
|
||||
private volatile boolean mSuppressCompositions;
|
||||
private volatile boolean mSuppressKeyUp;
|
||||
|
||||
@ -759,11 +760,16 @@ final class GeckoEditable
|
||||
});
|
||||
|
||||
// Register/unregister Gecko-side text selection listeners
|
||||
if (type == NOTIFY_IME_OF_BLUR) {
|
||||
// and update the mGeckoFocused flag.
|
||||
if (type == NOTIFY_IME_OF_BLUR && mGeckoFocused) {
|
||||
// Check for focus here because Gecko may send us a blur before a focus in some
|
||||
// cases, and we don't want to unregister an event that was not registered.
|
||||
mGeckoFocused = false;
|
||||
mSuppressCompositions = false;
|
||||
GeckoAppShell.getEventDispatcher().
|
||||
unregisterEventListener("TextSelection:IMECompositions", this);
|
||||
} else if (type == NOTIFY_IME_OF_FOCUS) {
|
||||
mGeckoFocused = true;
|
||||
mSuppressCompositions = false;
|
||||
GeckoAppShell.getEventDispatcher().
|
||||
registerEventListener("TextSelection:IMECompositions", this);
|
||||
|
Loading…
Reference in New Issue
Block a user