webkit编译后无法输入中文的解决方法

做如下修改即可: 
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;

猜你喜欢

转载自zage.iteye.com/blog/1866913