Commit b683f9b8 authored by weinig@apple.com's avatar weinig@apple.com

2011-03-15 Sam Weinig <sam@webkit.org>

        Reviewed by Anders Carlsson.

        WebKit2: False SPOD cursor when context menu is open
        <rdar://problem/9029154>
        https://bugs.webkit.org/show_bug.cgi?id=56433

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::showContextMenu):
        Update to match showPopupMenu idiomatically, and stop the responsivenessTimer
        since the act of showing the context menu could spin a nested runloop.

        * UIProcess/mac/WebContextMenuProxyMac.mm:
        (WebKit::WebContextMenuProxyMac::showContextMenu):
        * UIProcess/qt/WebContextMenuProxyQt.cpp:
        (WebKit::WebContextMenuProxyQt::showContextMenu):
        * UIProcess/win/WebContextMenuProxyWin.cpp:
        (WebKit::WebContextMenuProxyWin::showContextMenu):
        Move isEmpty() check to implementations, since we don't want to show
        this in any case, not just the one where we check it.


git-svn-id: svn://svn.chromium.org/blink/trunk@81205 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 9e948caa
2011-03-15 Sam Weinig <sam@webkit.org>
Reviewed by Anders Carlsson.
WebKit2: False SPOD cursor when context menu is open
<rdar://problem/9029154>
https://bugs.webkit.org/show_bug.cgi?id=56433
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::showContextMenu):
Update to match showPopupMenu idiomatically, and stop the responsivenessTimer
since the act of showing the context menu could spin a nested runloop.
* UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::WebContextMenuProxyMac::showContextMenu):
* UIProcess/qt/WebContextMenuProxyQt.cpp:
(WebKit::WebContextMenuProxyQt::showContextMenu):
* UIProcess/win/WebContextMenuProxyWin.cpp:
(WebKit::WebContextMenuProxyWin::showContextMenu):
Move isEmpty() check to implementations, since we don't want to show
this in any case, not just the one where we check it.
2011-03-15 Siddharth Mathur <siddharth.mathur@nokia.com>
Reviewed by Laszlo Gombos.
......
......@@ -2078,20 +2078,21 @@ void WebPageProxy::showContextMenu(const IntPoint& menuLocation, const ContextMe
m_activeContextMenuState = contextMenuState;
if (m_activeContextMenu)
if (m_activeContextMenu) {
m_activeContextMenu->hideContextMenu();
else
m_activeContextMenu = m_pageClient->createContextMenuProxy(this);
m_activeContextMenu = 0;
}
m_activeContextMenu = m_pageClient->createContextMenuProxy(this);
// Since showContextMenu() can spin a nested run loop we need to turn off the responsiveness timer.
process()->responsivenessTimer()->stop();
// Give the PageContextMenuClient one last swipe at changing the menu.
Vector<WebContextMenuItemData> items;
if (!m_contextMenuClient.getContextMenuFromProposedMenu(this, proposedItems, items, userData.get())) {
if (!m_contextMenuClient.getContextMenuFromProposedMenu(this, proposedItems, items, userData.get()))
m_activeContextMenu->showContextMenu(menuLocation, proposedItems);
return;
}
if (items.size())
else
m_activeContextMenu->showContextMenu(menuLocation, items);
}
......
......@@ -199,6 +199,9 @@ void WebContextMenuProxyMac::populate(const Vector<WebContextMenuItemData>& item
void WebContextMenuProxyMac::showContextMenu(const IntPoint& menuLocation, const Vector<WebContextMenuItemData>& items)
{
if (items.isEmpty())
return;
populate(items);
[[WKMenuTarget sharedMenuTarget] setMenuProxy:this];
......
......@@ -82,6 +82,9 @@ PassRefPtr<WebContextMenuProxyQt> WebContextMenuProxyQt::create(QWKPage* page)
void WebContextMenuProxyQt::showContextMenu(const IntPoint& position, const Vector<WebContextMenuItemData>& items)
{
if (items.isEmpty())
return;
OwnPtr<QMenu> menu = createContextMenu(items);
// We send the signal, even with no items, because the client should be able to show custom items
......
......@@ -73,6 +73,9 @@ void WebContextMenuProxyWin::populateMenu(HMENU menu, const Vector<WebContextMen
void WebContextMenuProxyWin::showContextMenu(const IntPoint& origin, const Vector<WebContextMenuItemData>& items)
{
if (items.isEmpty())
return;
// Hide any context menu we have showing (this also destroys the menu).
hideContextMenu();
......
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