From 65a3ec306e002c697ff4cf59d78896baadaff3eb Mon Sep 17 00:00:00 2001 From: blueboxd <48254131+blueboxd@users.noreply.github.com> Date: Wed, 8 May 2024 04:22:01 +0900 Subject: [PATCH] avoid using [NSWindow convertPointFromScreen:] --- ui/base/cocoa/menu_utils.mm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ui/base/cocoa/menu_utils.mm b/ui/base/cocoa/menu_utils.mm index 2352d38276bc5a..6601d11f02ad8e 100644 --- a/ui/base/cocoa/menu_utils.mm +++ b/ui/base/cocoa/menu_utils.mm @@ -4,13 +4,14 @@ #include "ui/base/cocoa/menu_utils.h" -#include - #import +#include + #import "base/mac/scoped_sending_event.h" #import "base/message_loop/message_pump_apple.h" #include "base/task/current_thread.h" +#include "ui/base/cocoa/cocoa_base_utils.h" #include "ui/base/interaction/element_tracker_mac.h" #include "ui/gfx/mac/coordinate_conversion.h" @@ -19,7 +20,7 @@ NSEvent* EventForPositioningContextMenu(const gfx::Point& anchor, NSWindow* window) { NSPoint location_in_window = - [window convertPointFromScreen:gfx::ScreenPointToNSPoint(anchor)]; + ui::ConvertPointFromScreenToWindow(window, gfx::ScreenPointToNSPoint(anchor)); return EventForPositioningContextMenuRelativeToWindow(location_in_window, window); }