Bug 975383 part.4 Remove compositionupdate dispatchers in nsGtkIMModule of GTK r=karlt

This commit is contained in:
Masayuki Nakano 2014-10-03 15:33:48 +09:00
parent 5c2ec48f6d
commit fd4d807e05

View File

@ -1092,21 +1092,6 @@ nsGtkIMModule::DispatchTextEvent(const nsAString &aCompositionString,
nsEventStatus status;
nsRefPtr<nsWindow> lastFocusedWindow = mLastFocusedWindow;
if (aCompositionString != mDispatchedCompositionString) {
WidgetCompositionEvent compositionUpdate(true, NS_COMPOSITION_UPDATE,
mLastFocusedWindow);
InitEvent(compositionUpdate);
compositionUpdate.data = aCompositionString;
mDispatchedCompositionString = aCompositionString;
mLastFocusedWindow->DispatchEvent(&compositionUpdate, status);
if (lastFocusedWindow->IsDestroyed() ||
lastFocusedWindow != mLastFocusedWindow) {
PR_LOG(gGtkIMLog, PR_LOG_ALWAYS,
(" NOTE, the focused widget was destroyed/changed by compositionupdate"));
return false;
}
}
// Store the selected string which will be removed by following text event.
if (mCompositionState == eCompositionState_CompositionStartDispatched) {
// XXX We should assume, for now, any web applications don't change
@ -1126,6 +1111,8 @@ nsGtkIMModule::DispatchTextEvent(const nsAString &aCompositionString,
uint32_t targetOffset = mCompositionStart;
textEvent.theText = mDispatchedCompositionString = aCompositionString;
if (!aIsCommit) {
// NOTE: SetTextRangeList() assumes that mDispatchedCompositionString
// has been updated already.
@ -1133,8 +1120,6 @@ nsGtkIMModule::DispatchTextEvent(const nsAString &aCompositionString,
targetOffset += textEvent.mRanges->TargetClauseOffset();
}
textEvent.theText = mDispatchedCompositionString.get();
mCompositionState = aIsCommit ?
eCompositionState_CommitTextEventDispatched :
eCompositionState_TextEventDispatched;