Changeset 84019 in webkit


Ignore:
Timestamp:
Apr 15, 2011 12:46:49 PM (13 years ago)
Author:
bweinstein@apple.com
Message:

Views should be made visible before painting in WM_PRINTCLIENT messages
https://bugs.webkit.org/show_bug.cgi?id=58676
<rdar://problem/9279211>

Reviewed by Adam Roben.

  • UIProcess/win/WebView.cpp:

(WebKit::WebView::onPrintClientEvent): If our view isn't currently visible set it to visible

before painting, then reset it back to not visible after painting.

(WebKit::WebView::onShowWindowEvent): Call setIsVisible instead of duplicating logic.
(WebKit::WebView::setIsVisible): Set the m_isVisible flag and call viewStateDidChange.

  • UIProcess/win/WebView.h:
Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r84017 r84019  
     12011-04-15  Brian Weinstein  <bweinstein@apple.com>
     2
     3        Reviewed by Adam Roben.
     4
     5        Views should be made visible before painting in WM_PRINTCLIENT messages
     6        https://bugs.webkit.org/show_bug.cgi?id=58676
     7        <rdar://problem/9279211>
     8
     9        * UIProcess/win/WebView.cpp:
     10        (WebKit::WebView::onPrintClientEvent): If our view isn't currently visible set it to visible
     11            before painting, then reset it back to not visible after painting.
     12        (WebKit::WebView::onShowWindowEvent): Call setIsVisible instead of duplicating logic.
     13        (WebKit::WebView::setIsVisible): Set the m_isVisible flag and call viewStateDidChange.
     14        * UIProcess/win/WebView.h:
     15
    1162011-04-15  Jon Lee  <jonlee@apple.com>
    217
  • trunk/Source/WebKit2/UIProcess/win/WebView.cpp

    r84017 r84019  
    692692    ::GetClientRect(hWnd, &winRect);
    693693
     694    // Twidding the visibility flags tells the DrawingArea to resume painting. Right now, the
     695    // the visible state of the view only affects whether or not painting happens, but in the
     696    // future it could affect more, which we wouldn't want to touch here.
     697
     698    // FIXME: We should have a better way of telling the WebProcess to draw even if we're
     699    // invisible than twiddling the visibility flag.
     700
     701    bool wasVisible = isViewVisible();
     702    if (!wasVisible)
     703        setIsVisible(true);
     704
    694705    paint(hdc, winRect);
     706
     707    if (!wasVisible)
     708        setIsVisible(false);
    695709
    696710    handled = true;
     
    753767    // FIXME: Since we don't get notified when an ancestor window is hidden or shown, we will keep
    754768    // painting even when we have a hidden ancestor. <http://webkit.org/b/54104>
    755     if (!lParam) {
    756         m_isVisible = wParam;
    757         if (m_page)
    758             m_page->viewStateDidChange(WebPageProxy::ViewIsVisible);
    759     }
     769    if (!lParam)
     770        setIsVisible(wParam);
    760771
    761772    handled = false;
     
    14701481}
    14711482
     1483void WebView::setIsVisible(bool isVisible)
     1484{
     1485    m_isVisible = isVisible;
     1486
     1487    if (m_page)
     1488        m_page->viewStateDidChange(WebPageProxy::ViewIsVisible);
     1489}
     1490
    14721491#if USE(ACCELERATED_COMPOSITING)
    14731492
  • trunk/Source/WebKit2/UIProcess/win/WebView.h

    r83531 r84019  
    6161    void windowAncestryDidChange();
    6262    void setIsInWindow(bool);
     63    void setIsVisible(bool);
    6364    void setOverrideCursor(HCURSOR);
    6465    void setInitialFocus(bool forward);
Note: See TracChangeset for help on using the changeset viewer.