Commit 010fb4e7 authored by oliver's avatar oliver

Reviewed by Maciej.

        Fix for <rdar://problem/5334826> Chinese IME composition window does not appear in the correct location

        Respect IME requests for character position.

        * WebView.cpp:
        (WebView::onIMERequestCharPosition):
        (WebView::onIMERequest):
        * WebView.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@24343 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 69bbf8f7
2007-07-16 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
Fix for <rdar://problem/5334826> Chinese IME composition window does not appear in the correct location
Respect IME requests for character position.
* WebView.cpp:
(WebView::onIMERequestCharPosition):
(WebView::onIMERequest):
* WebView.h:
2007-07-16 Adam Roben <aroben@apple.com>
WebKit/win part of <rdar://problem/5336005> Calling window.print() on a subframe prints whole page, should only print that subframe
......
......@@ -3911,8 +3911,36 @@ bool WebView::onIMENotify(WPARAM, LPARAM, LRESULT*)
return false;
}
bool WebView::onIMERequest(WPARAM, LPARAM, LRESULT*)
bool WebView::onIMERequestCharPosition(IMECHARPOSITION* charPos, LRESULT* result)
{
IntRect caret;
Frame* targetFrame = m_page->focusController()->focusedOrMainFrame();
if (!targetFrame)
return true;
if (RefPtr<Range> range = targetFrame->selectionController()->selection().toRange()) {
ExceptionCode ec = 0;
RefPtr<Range> tempRange = range->cloneRange(ec);
caret = targetFrame->firstRectForRange(tempRange.get());
}
caret = targetFrame->view()->contentsToWindow(caret);
charPos->pt.x = caret.x();
charPos->pt.y = caret.y();
::ClientToScreen(m_viewWindow, &charPos->pt);
charPos->cLineHeight = caret.height();
::GetWindowRect(m_viewWindow, &charPos->rcDocument);
*result = TRUE;
return true;
}
bool WebView::onIMERequest(WPARAM request, LPARAM data, LRESULT* result)
{
switch (request) {
case IMR_RECONVERTSTRING:
return false;
case IMR_QUERYCHARPOSITION:
return onIMERequestCharPosition((IMECHARPOSITION*)data, result);
}
return false;
}
......
......@@ -675,6 +675,7 @@ protected:
void initializeToolTipWindow();
void prepareCandidateWindow(WebCore::Frame*, HIMC);
void updateSelectionForIME();
bool onIMERequestCharPosition(IMECHARPOSITION*, LRESULT*);
ULONG m_refCount;
WebCore::String m_groupName;
HWND m_hostWindow;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment