Changeset 31128 in webkit


Ignore:
Timestamp:
Mar 18, 2008 9:40:30 AM (16 years ago)
Author:
Adam Roben
Message:

Fix Bug 14276: Element highlight also covers Web inspector

<http://bugs.webkit.org/show_bug.cgi?id=14276>
<rdar://5712796>

Also fixes <rdar://5622837> Browser window comes to front when node
highlight appears, potentially blocking Inspector

Reviewed by Mitz.

  • WebCoreSupport/WebInspectorClient.cpp: (WebInspectorClient::highlight): After showing the highlight, reposition it just behind the Inspector's window.
  • WebNodeHighlight.cpp: (WebNodeHighlight::show):
    • Changed flags passed to CreateWindowEx to not specify WS_VISIBLE. This is not needed because we'll show the window later in this function.
    • Removed call to SetWindowPos that tried to position the overlay just in front of the WebView. This is now handled by WebInspectorClient.
    • Changed call to ShowWindow to use SetWindowPos so that we can pass SWP_NOACTIVATE. This prevents the highlight from jumping in front of the Inspector every time it's shown.
  • WebNodeHighlight.h: Added a method to get the highlight's HWND.
Location:
trunk/WebKit/win
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/win/ChangeLog

    r31073 r31128  
     12008-03-18  Adam Roben  <aroben@apple.com>
     2
     3        Fix Bug 14276: Element highlight also covers Web inspector
     4
     5        <http://bugs.webkit.org/show_bug.cgi?id=14276>
     6        <rdar://5712796>
     7
     8        Also fixes <rdar://5622837> Browser window comes to front when node
     9        highlight appears, potentially blocking Inspector
     10
     11        Reviewed by Mitz.
     12
     13        * WebCoreSupport/WebInspectorClient.cpp:
     14        (WebInspectorClient::highlight): After showing the highlight,
     15        reposition it just behind the Inspector's window.
     16        * WebNodeHighlight.cpp:
     17        (WebNodeHighlight::show):
     18          - Changed flags passed to CreateWindowEx to not specify WS_VISIBLE.
     19            This is not needed because we'll show the window later in this
     20            function.
     21          - Removed call to SetWindowPos that tried to position the overlay
     22            just in front of the WebView. This is now handled by
     23            WebInspectorClient.
     24          - Changed call to ShowWindow to use SetWindowPos so that we can pass
     25            SWP_NOACTIVATE. This prevents the highlight from jumping in front
     26            of the Inspector every time it's shown.
     27        * WebNodeHighlight.h: Added a method to get the highlight's HWND.
     28
    1292008-03-14  Steve Falkenburg  <sfalken@apple.com>
    230
  • trunk/WebKit/win/WebCoreSupport/WebInspectorClient.cpp

    r30912 r31128  
    274274
    275275    m_highlight->show();
     276
     277    if (IsWindowVisible(m_hwnd)) {
     278        // Make sure the highlight is behind us.
     279        SetWindowPos(m_highlight->window(), m_hwnd, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
     280    }
    276281}
    277282
  • trunk/WebKit/win/WebNodeHighlight.cpp

    r30911 r31128  
    7474        registerOverlayClass();
    7575
    76         m_overlay = ::CreateWindowEx(WS_EX_LAYERED | WS_EX_TOOLWINDOW, kOverlayWindowClassName, 0, WS_POPUP | WS_VISIBLE,
     76        m_overlay = ::CreateWindowEx(WS_EX_LAYERED | WS_EX_TOOLWINDOW, kOverlayWindowClassName, 0, WS_POPUP,
    7777                                     0, 0, 0, 0,
    7878                                     m_inspectedWebViewWindow, 0, 0, 0);
     
    8181
    8282        ::SetProp(m_overlay, kWebNodeHighlightPointerProp, reinterpret_cast<HANDLE>(this));
    83         ::SetWindowPos(m_overlay, m_inspectedWebViewWindow, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
    8483
    8584        m_observedWindow = GetAncestor(m_inspectedWebViewWindow, GA_ROOT);
     
    8988
    9089    updateWindow();
    91     ::ShowWindow(m_overlay, SW_SHOW);
     90    SetWindowPos(m_overlay, 0, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
    9291}
    9392
  • trunk/WebKit/win/WebNodeHighlight.h

    r30911 r31128  
    4949    bool visible() const;
    5050
     51    HWND window() const { return m_overlay; }
     52
    5153private:
    5254    virtual void windowReceivedMessage(HWND, UINT message, WPARAM, LPARAM);
Note: See TracChangeset for help on using the changeset viewer.