Bug 558978 Looks like composition isn't committed after I clicked r=karlt

This commit is contained in:
Masayuki Nakano 2010-04-14 20:27:20 +09:00
parent 4581294096
commit 2ba4e16ca7

View File

@ -770,13 +770,15 @@ nsGtkIMModule::OnEndCompositionNative(GtkIMContext *aContext)
return;
}
PRBool shouldIgnoreThisEvent = ShouldIgnoreNativeCompositionEvent();
// Finish the cancelling mode here rather than DispatchCompositionEnd()
// because DispatchCompositionEnd() is called ourselves when we need to
// commit the composition string *before* the focus moves completely.
// Note that the native commit can be fired *after* ResetIME().
mIgnoreNativeCompositionEvent = PR_FALSE;
if (!mIsComposing) {
if (!mIsComposing || shouldIgnoreThisEvent) {
// If we already handled the commit event, we should do nothing here.
return;
}
@ -988,12 +990,13 @@ nsGtkIMModule::GetCompositionString(nsAString &aCompositionString)
} else {
aCompositionString.Truncate();
}
pango_attr_list_unref(feedback_list);
g_free(preedit_string);
PR_LOG(gGtkIMLog, PR_LOG_ALWAYS,
("GtkIMModule(%p): GetCompositionString, result=\"%s\"",
this, preedit_string));
pango_attr_list_unref(feedback_list);
g_free(preedit_string);
}
PRBool