alloy: Use Views context menus on Windows/Linux (fixes issue #3330)

This commit is contained in:
Marshall Greenblatt
2022-05-13 14:38:41 +03:00
parent 2dcee2ccfc
commit 7a372a642b
41 changed files with 475 additions and 1418 deletions

View File

@@ -324,9 +324,11 @@ void CefBrowserPlatformDelegateNativeMac::SetFocus(bool setFocus) {
}
gfx::Point CefBrowserPlatformDelegateNativeMac::GetScreenPoint(
const gfx::Point& view) const {
const gfx::Point& view,
bool want_dip_coords) const {
// Mac always operates in DIP coordinates so |want_dip_coords| is ignored.
if (windowless_handler_)
return windowless_handler_->GetParentScreenPoint(view);
return windowless_handler_->GetParentScreenPoint(view, want_dip_coords);
NSView* nsview = CAST_CEF_WINDOW_HANDLE_TO_NSVIEW(window_info_.parent_view);
if (nsview) {
@@ -543,8 +545,8 @@ void CefBrowserPlatformDelegateNativeMac::TranslateWebMouseEvent(
// position
result.SetPositionInWidget(mouse_event.x, mouse_event.y);
const gfx::Point& screen_pt =
GetScreenPoint(gfx::Point(mouse_event.x, mouse_event.y));
const gfx::Point& screen_pt = GetScreenPoint(
gfx::Point(mouse_event.x, mouse_event.y), /*want_dip_coords=*/true);
result.SetPositionInScreen(screen_pt.x(), screen_pt.y());
// modifiers