From 653ef6f8394ecd0ee2360764ee2d0da27623440c Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 5 Jun 2017 10:33:46 -0700 Subject: [PATCH] :art: --- atom/browser/api/atom_api_screen.h | 2 ++ atom/browser/api/atom_api_screen_mac.mm | 1 + docs/api/screen.md | 4 +--- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/atom/browser/api/atom_api_screen.h b/atom/browser/api/atom_api_screen.h index 6e2af6d6fcb83..1af170327d455 100644 --- a/atom/browser/api/atom_api_screen.h +++ b/atom/browser/api/atom_api_screen.h @@ -39,9 +39,11 @@ class Screen : public mate::EventEmitter, std::vector GetAllDisplays(); display::Display GetDisplayNearestPoint(const gfx::Point& point); display::Display GetDisplayMatching(const gfx::Rect& match_rect); + #if defined(OS_MACOSX) int getMenuBarHeight(); #endif + // display::DisplayObserver: void OnDisplayAdded(const display::Display& new_display) override; void OnDisplayRemoved(const display::Display& old_display) override; diff --git a/atom/browser/api/atom_api_screen_mac.mm b/atom/browser/api/atom_api_screen_mac.mm index 5d4b15dc055a6..0d22fad5b8b5e 100644 --- a/atom/browser/api/atom_api_screen_mac.mm +++ b/atom/browser/api/atom_api_screen_mac.mm @@ -8,6 +8,7 @@ namespace atom { namespace api { + int Screen::getMenuBarHeight() { return [[NSApp mainMenu] menuBarHeight]; } diff --git a/docs/api/screen.md b/docs/api/screen.md index 1f97f60a09bf5..e84da88c831b9 100644 --- a/docs/api/screen.md +++ b/docs/api/screen.md @@ -97,9 +97,7 @@ The current absolute position of the mouse pointer. ### `screen.getMenuBarHeight()` _macOS_ -Returns `Integer` - Height - -The height of toolbar in pixels. +Returns `Integer` - The height of the menu bar in pixels. ### `screen.getPrimaryDisplay()`