做如下修改即可:
bool WebView::onIMEComposition(LPARAM lparam)
{
LOG(TextInput, "onIMEComposition %s", imeCompositionArgumentNames(lparam).latin1().data());
HIMC hInputContext = getIMMContext();
if (!hInputContext)
return true;
Frame* targetFrame = m_page->focusController()->focusedOrMainFrame();
if (!targetFrame || !targetFrame->editor()->canEdit())
return true;
String compositionString;
prepareCandidateWindow(targetFrame, hInputContext);
if( (lparam&GCS_RESULTSTR) == GCS_RESULTSTR )
{
if (!getCompositionString(hInputContext, GCS_RESULTSTR, compositionString) && lparam)
return true;
targetFrame->editor()->confirmComposition(compositionString);
}
if( (lparam&GCS_COMPSTR) == GCS_COMPSTR )
{
return false;
}
return false;
}
{
LOG(TextInput, "onIMEComposition %s", imeCompositionArgumentNames(lparam).latin1().data());
HIMC hInputContext = getIMMContext();
if (!hInputContext)
return true;
Frame* targetFrame = m_page->focusController()->focusedOrMainFrame();
if (!targetFrame || !targetFrame->editor()->canEdit())
return true;
String compositionString;
prepareCandidateWindow(targetFrame, hInputContext);
if( (lparam&GCS_RESULTSTR) == GCS_RESULTSTR )
{
if (!getCompositionString(hInputContext, GCS_RESULTSTR, compositionString) && lparam)
return true;
targetFrame->editor()->confirmComposition(compositionString);
}
if( (lparam&GCS_COMPSTR) == GCS_COMPSTR )
{
return false;
}
return false;
}