Changeset 192335 in webkit


Ignore:
Timestamp:
Nov 11, 2015, 4:47:29 PM (10 years ago)
Author:
andersca@apple.com
Message:

REGRESSION (r191407): Context menus are missing Services
https://bugs.webkit.org/show_bug.cgi?id=151167
rdar://problem/23500769

Reviewed by Tim Horton.

  • UIProcess/mac/WebContextMenuProxyMac.mm:

(WebKit::WebContextMenuProxyMac::showContextMenu):
Use contentsToRootView to better indicate which coordinate system we're using.

  • WebProcess/WebPage/WebContextMenu.cpp:

(WebKit::WebContextMenu::show):
Use +[NSMenu popUpContextMenu:withEvent:forView:] so we'll get service menus where applicable.

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r192333 r192335  
     12015-11-11  Anders Carlsson  <andersca@apple.com>
     2
     3        REGRESSION (r191407): Context menus are missing Services
     4        https://bugs.webkit.org/show_bug.cgi?id=151167
     5        rdar://problem/23500769
     6
     7        Reviewed by Tim Horton.
     8
     9        * UIProcess/mac/WebContextMenuProxyMac.mm:
     10        (WebKit::WebContextMenuProxyMac::showContextMenu):
     11        Use contentsToRootView to better indicate which coordinate system we're using.
     12
     13        * WebProcess/WebPage/WebContextMenu.cpp:
     14        (WebKit::WebContextMenu::show):
     15        Use +[NSMenu popUpContextMenu:withEvent:forView:] so we'll get service menus where applicable.
     16
    1172015-11-11  Anders Carlsson  <andersca@apple.com>
    218
  • trunk/Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.mm

    r191824 r192335  
    392392
    393393    [[WKMenuTarget sharedMenuTarget] setMenuProxy:this];
    394     [m_menu popUpMenuPositioningItem:nil atLocation:m_context.menuLocation() inView:m_webView];
     394
     395    NSPoint menuLocation = [m_webView convertPoint:m_context.menuLocation() toView:nil];
     396    NSEvent *event = [NSEvent mouseEventWithType:NSRightMouseUp location:menuLocation modifierFlags:0 timestamp:0 windowNumber:m_webView.window.windowNumber context:nil eventNumber:0 clickCount:0 pressure:0];
     397    [NSMenu popUpContextMenu:m_menu.get() withEvent:event forView:m_webView];
    395398}
    396399
  • trunk/Source/WebKit2/WebProcess/WebPage/WebContextMenu.cpp

    r191131 r192335  
    6565    menuItemsWithUserData(menuItems, userData);
    6666
    67     auto menuLocation = view->contentsToWindow(controller.hitTestResult().roundedPointInInnerNodeFrame());
     67    auto menuLocation = view->contentsToRootView(controller.hitTestResult().roundedPointInInnerNodeFrame());
     68
    6869    ContextMenuContextData contextMenuContextData(menuLocation, menuItems, controller.context());
    6970
Note: See TracChangeset for help on using the changeset viewer.