Bug 1121313 - Part 2. Don't generate composition event on child process if parent process doesn't send composition event by NotifyIME. r=masayuki
This commit is contained in:
@@ -109,7 +109,6 @@ PuppetWidget::Create(nsIWidget *aParent,
|
||||
mDrawTarget = gfxPlatform::GetPlatform()->
|
||||
CreateOffscreenContentDrawTarget(IntSize(1, 1), SurfaceFormat::B8G8R8A8);
|
||||
|
||||
mIMEComposing = false;
|
||||
mNeedIMEStateInit = MightNeedIMEFocus(aInitData);
|
||||
|
||||
PuppetWidget* parent = static_cast<PuppetWidget*>(aParent);
|
||||
@@ -305,9 +304,6 @@ PuppetWidget::DispatchEvent(WidgetGUIEvent* event, nsEventStatus& aStatus)
|
||||
|
||||
aStatus = nsEventStatus_eIgnore;
|
||||
|
||||
if (event->message == NS_COMPOSITION_START) {
|
||||
mIMEComposing = true;
|
||||
}
|
||||
uint32_t seqno = kLatestSeqno;
|
||||
switch (event->mClass) {
|
||||
case eCompositionEventClass:
|
||||
@@ -330,11 +326,6 @@ PuppetWidget::DispatchEvent(WidgetGUIEvent* event, nsEventStatus& aStatus)
|
||||
aStatus = mAttachedWidgetListener->HandleEvent(event, mUseAttachedEvents);
|
||||
}
|
||||
|
||||
if (event->mClass == eCompositionEventClass &&
|
||||
event->AsCompositionEvent()->CausesDOMCompositionEndEvent()) {
|
||||
mIMEComposing = false;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@@ -402,19 +393,21 @@ PuppetWidget::IMEEndComposition(bool aCancel)
|
||||
#endif
|
||||
|
||||
nsEventStatus status;
|
||||
bool noCompositionEvent = true;
|
||||
WidgetCompositionEvent compositionCommitEvent(true, NS_COMPOSITION_COMMIT,
|
||||
this);
|
||||
InitEvent(compositionCommitEvent, nullptr);
|
||||
// SendEndIMEComposition is always called since ResetInputState
|
||||
// should always be called even if we aren't composing something.
|
||||
if (!mTabChild ||
|
||||
!mTabChild->SendEndIMEComposition(aCancel,
|
||||
!mTabChild->SendEndIMEComposition(aCancel, &noCompositionEvent,
|
||||
&compositionCommitEvent.mData)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
if (!mIMEComposing)
|
||||
if (noCompositionEvent) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
compositionCommitEvent.mSeqno = mIMELastReceivedSeqno;
|
||||
DispatchEvent(&compositionCommitEvent, status);
|
||||
|
||||
Reference in New Issue
Block a user