[webkit-help] Unfinished Webkit2 Callbacks

Adam Roben aroben at apple.com
Thu Feb 10 06:17:36 PST 2011


On Jan 31, 2011, at 3:41 PM, Nick Guenther wrote:

> I'm using WebKit2 and trying to capture when it's drawn. The trouble is I want to do this to an offscreen window. I'm sending WM_PRINTCLIENT but after some digging I found that while the WM_PAINT handler emits a didDraw(), the WM_PRINTCLIENT one does not:
> 
> Source\WebKit2\UIProcess\win:
> 
> LRESULT WebView::onPaintEvent(HWND hWnd, UINT message, WPARAM, LPARAM, bool& handled)
> {
>    PAINTSTRUCT paintStruct;
>    HDC hdc = ::BeginPaint(m_window, &paintStruct);
> 
>    if (m_page->isValid() && m_page->drawingArea() && m_page->drawingArea()->paint(IntRect(paintStruct.rcPaint), hdc))
>        m_page->didDraw();
>    else {
>        // Mac checks WebPageProxy::drawsBackground and
>        // WebPageProxy::drawsTransparentBackground here, but those are always false on Windows
>        // currently (see <http://webkit.org/b/52009>).
>        ::FillRect(hdc, &paintStruct.rcPaint, reinterpret_cast<HBRUSH>(COLOR_WINDOW + 1));
>    }
> 
>    ::EndPaint(m_window, &paintStruct);
> 
>    handled = true;
>    return 0;
> }
> 
> LRESULT WebView::onPrintClientEvent(HWND hWnd, UINT, WPARAM wParam, LPARAM, bool& handled)
> {
>    HDC hdc = reinterpret_cast<HDC>(wParam);
>    RECT winRect;
>    ::GetClientRect(hWnd, &winRect);
>    IntRect rect = winRect;
> 
>    m_page->drawingArea()->paint(rect, hdc);
> 
>    handled = true;
>    return 0;
> }
> 
> Would it be reasonable to add didDraw() to onPrintClientEvent()?

Yes. I actually just fixed this in r78200.

> Actually I noticed a whole bunch of callbacks actually aren't called, in WebPageProxy.h are declared private, even, like setWindowFrame. What's the plan for all these, is anyone working on them?

setWindowFrame is called when a Messages::WebPageProxy::SetWebFrame message is received from the web process. The web process sends this message when WebChromeClient::setWindowRect is called.

-Adam


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-help/attachments/20110210/0b5ba4ec/attachment.html>


More information about the webkit-help mailing list