diff --git a/shell/browser/api/electron_api_menu_mac.mm b/shell/browser/api/electron_api_menu_mac.mm index c57391b19487f..35e3d465975ab 100644 --- a/shell/browser/api/electron_api_menu_mac.mm +++ b/shell/browser/api/electron_api_menu_mac.mm @@ -134,7 +134,7 @@ if (!item) { CGFloat windowBottom = CGRectGetMinY([view window].frame); CGFloat lowestMenuPoint = windowBottom + position.y - [menu size].height; - CGFloat screenBottom = CGRectGetMinY([view window].screen.frame); + CGFloat screenBottom = CGRectGetMinY([view window].screen.visibleFrame); CGFloat distanceFromBottom = lowestMenuPoint - screenBottom; if (distanceFromBottom < 0) position.y = position.y - distanceFromBottom + 4; @@ -143,7 +143,7 @@ // Place the menu left of cursor if it is overflowing off right of screen. CGFloat windowLeft = CGRectGetMinX([view window].frame); CGFloat rightmostMenuPoint = windowLeft + position.x + [menu size].width; - CGFloat screenRight = CGRectGetMaxX([view window].screen.frame); + CGFloat screenRight = CGRectGetMaxX([view window].screen.visibleFrame); if (rightmostMenuPoint > screenRight) position.x = position.x - [menu size].width;