Skip to content

Commit

Permalink
avoid using [NSWindow convertPointFromScreen:]
Browse files Browse the repository at this point in the history
  • Loading branch information
blueboxd committed May 7, 2024
1 parent a007c02 commit 65a3ec3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ui/base/cocoa/menu_utils.mm
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@

#include "ui/base/cocoa/menu_utils.h"

#include <optional>

#import <AppKit/AppKit.h>

#include <optional>

#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"

Expand All @@ -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);
}
Expand Down

0 comments on commit 65a3ec3

Please sign in to comment.