From 72c63a10ee7707d8dc342db921c0228f1a39ea76 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Wed, 23 May 2018 09:11:48 -0700 Subject: [PATCH] remove screen.getMenuBarHeight() deprecation --- atom/browser/api/atom_api_screen.cc | 3 --- atom/browser/api/atom_api_screen.h | 4 ---- atom/browser/api/atom_api_screen_mac.mm | 19 ------------------- docs/api/screen.md | 4 ---- docs/tutorial/planned-breaking-changes.md | 9 --------- lib/browser/api/screen.js | 9 --------- 6 files changed, 48 deletions(-) delete mode 100644 atom/browser/api/atom_api_screen_mac.mm diff --git a/atom/browser/api/atom_api_screen.cc b/atom/browser/api/atom_api_screen.cc index b382d3257..65a11eed0 100644 --- a/atom/browser/api/atom_api_screen.cc +++ b/atom/browser/api/atom_api_screen.cc @@ -145,9 +145,6 @@ void Screen::BuildPrototype(v8::Isolate* isolate, .SetMethod("dipToScreenPoint", &display::win::ScreenWin::DIPToScreenPoint) .SetMethod("screenToDipRect", &ScreenToDIPRect) .SetMethod("dipToScreenRect", &DIPToScreenRect) -#endif -#if defined(OS_MACOSX) - .SetMethod("getMenuBarHeight", &Screen::getMenuBarHeight) #endif .SetMethod("getDisplayMatching", &Screen::GetDisplayMatching); } diff --git a/atom/browser/api/atom_api_screen.h b/atom/browser/api/atom_api_screen.h index 105c924e2..33c322abf 100644 --- a/atom/browser/api/atom_api_screen.h +++ b/atom/browser/api/atom_api_screen.h @@ -40,10 +40,6 @@ class Screen : public mate::EventEmitter, 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 deleted file mode 100644 index 4b213b9ab..000000000 --- a/atom/browser/api/atom_api_screen_mac.mm +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) 2017 GitHub, Inc. -// Use of this source code is governed by the MIT license that can be -// found in the LICENSE file. - -#import -#import "atom/browser/api/atom_api_screen.h" - -namespace atom { - -namespace api { - -// TODO(codebytere): deprecated; remove in 3.0 -int Screen::getMenuBarHeight() { - return [[NSApp mainMenu] menuBarHeight]; -} - -} // namespace api - -} // namespace atom diff --git a/docs/api/screen.md b/docs/api/screen.md index c162ba8ca..cf96c456f 100644 --- a/docs/api/screen.md +++ b/docs/api/screen.md @@ -95,10 +95,6 @@ Returns [`Point`](structures/point.md) The current absolute position of the mouse pointer. -### `screen.getMenuBarHeight()` _macOS_ - -Returns `Integer` - The height of the menu bar in pixels. - ### `screen.getPrimaryDisplay()` Returns [`Display`](structures/display.md) - The primary display. diff --git a/docs/tutorial/planned-breaking-changes.md b/docs/tutorial/planned-breaking-changes.md index ac13bf084..90f6b6045 100644 --- a/docs/tutorial/planned-breaking-changes.md +++ b/docs/tutorial/planned-breaking-changes.md @@ -40,15 +40,6 @@ nativeImage.createFromBuffer(buffer, { }) ``` -## `screen` - -```js -// Deprecated -screen.getMenuBarHeight() -// Replace with -screen.getPrimaryDisplay().workArea -``` - ## `session` ```js diff --git a/lib/browser/api/screen.js b/lib/browser/api/screen.js index bbbc1bbe1..8287bfa8b 100644 --- a/lib/browser/api/screen.js +++ b/lib/browser/api/screen.js @@ -1,17 +1,8 @@ const {EventEmitter} = require('events') -const {deprecate} = require('electron') const {screen, Screen} = process.atomBinding('screen') // Screen is an EventEmitter. Object.setPrototypeOf(Screen.prototype, EventEmitter.prototype) EventEmitter.call(screen) -const nativeFn = screen.getMenuBarHeight -screen.getMenuBarHeight = function () { - if (!process.noDeprecations) { - deprecate.warn('screen.getMenuBarHeight', 'screen.getPrimaryDisplay().workArea') - } - return nativeFn.call(this) -} - module.exports = screen