Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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.


Canonical link: https://commits.webkit.org/71082@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@81205 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
weinig committed Mar 16, 2011
1 parent c878980 commit 638acf0
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 9 deletions.
22 changes: 22 additions & 0 deletions Source/WebKit2/ChangeLog
@@ -1,3 +1,25 @@
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.
Expand Down
19 changes: 10 additions & 9 deletions Source/WebKit2/UIProcess/WebPageProxy.cpp
Expand Up @@ -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);
}

Expand Down
3 changes: 3 additions & 0 deletions Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.mm
Expand Up @@ -199,6 +199,9 @@ static void populateNSMenu(NSMenu* menu, const Vector<RetainPtr<NSMenuItem> >& m

void WebContextMenuProxyMac::showContextMenu(const IntPoint& menuLocation, const Vector<WebContextMenuItemData>& items)
{
if (items.isEmpty())
return;

populate(items);
[[WKMenuTarget sharedMenuTarget] setMenuProxy:this];

Expand Down
3 changes: 3 additions & 0 deletions Source/WebKit2/UIProcess/qt/WebContextMenuProxyQt.cpp
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions Source/WebKit2/UIProcess/win/WebContextMenuProxyWin.cpp
Expand Up @@ -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();

Expand Down

0 comments on commit 638acf0

Please sign in to comment.