mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 808287 - Use counter instead of boolean to mask events after focus change; r=cpeterson
This commit is contained in:
parent
ad6de44c12
commit
f64bbf94d5
@ -164,7 +164,7 @@ nsWindow::nsWindow() :
|
||||
mIMEComposing(false),
|
||||
mIMEMaskSelectionUpdate(false),
|
||||
mIMEMaskTextUpdate(false),
|
||||
mIMEMaskEvents(true) // Mask IME events since there's no focus yet
|
||||
mIMEMaskEventsCount(1) // Mask IME events since there's no focus yet
|
||||
{
|
||||
}
|
||||
|
||||
@ -1883,10 +1883,11 @@ nsWindow::OnIMEEvent(AndroidGeckoEvent *ae)
|
||||
nsRefPtr<nsWindow> kungFuDeathGrip(this);
|
||||
|
||||
if (ae->Action() == AndroidGeckoEvent::IME_ACKNOWLEDGE_FOCUS) {
|
||||
mIMEMaskEvents = false;
|
||||
MOZ_ASSERT(mIMEMaskEventsCount > 0);
|
||||
mIMEMaskEventsCount--;
|
||||
return;
|
||||
}
|
||||
if (mIMEMaskEvents) {
|
||||
if (mIMEMaskEventsCount > 0) {
|
||||
// Still reply to events, but don't do anything else
|
||||
if (ae->Action() == AndroidGeckoEvent::IME_SYNCHRONIZE ||
|
||||
ae->Action() == AndroidGeckoEvent::IME_REPLACE_TEXT) {
|
||||
@ -2184,7 +2185,7 @@ nsWindow::OnIMEFocusChange(bool aFocus)
|
||||
// Mask events because we lost focus. On the next focus event, Gecko will notify
|
||||
// Java, and Java will send an acknowledge focus event back to Gecko. That is
|
||||
// where we unmask event handling
|
||||
mIMEMaskEvents = true;
|
||||
mIMEMaskEventsCount++;
|
||||
}
|
||||
|
||||
AndroidBridge::NotifyIME(AndroidBridge::NOTIFY_IME_FOCUSCHANGE,
|
||||
|
@ -184,7 +184,7 @@ protected:
|
||||
|
||||
bool mIMEComposing;
|
||||
bool mIMEMaskSelectionUpdate, mIMEMaskTextUpdate;
|
||||
bool mIMEMaskEvents;
|
||||
int32_t mIMEMaskEventsCount; // Mask events when > 0
|
||||
nsString mIMEComposingText;
|
||||
nsAutoTArray<nsTextRange, 4> mIMERanges;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user