feat: BrowserWindow.getNormalBounds() (#13290)

* First commit

* Add Mac support (1st attempt)

* Add Mac support (2nd attempt)

* Simplify tests

* Restore window state !

* Looking at other tests, seems minimize, maximize, fullscreen are skipped when in CI

* Fix Mac tests

* Restore tests in CI

* Fix typo

* widget getRestoredBounds not working on Mac !!

* widget getRestoredBounds not working on Mac !!

* Add IsNormal function

* Add IsNormal

* IsNormal => isNormal

* Deactivate fullscreen on Mac. Do not receive leave-fullscreen event

* Set default original_frame_

* Set default original_frame_

* Fix Mac
This commit is contained in:
Emmanuel Kimmerlin 2018-08-24 23:33:27 +02:00 committed by Samuel Attard
parent 872890ea5c
commit 5f6706ac33
10 changed files with 176 additions and 1 deletions

View file

@ -816,6 +816,10 @@ Simple fullscreen mode emulates the native fullscreen behavior found in versions
Returns `Boolean` - Whether the window is in simple (pre-Lion) fullscreen mode.
#### `win.isNormal()`
Returns `Boolean` - Whether the window is in normal state (not maximized, not minimized, not in fullscreen mode).
#### `win.setAspectRatio(aspectRatio[, extraSize])` _macOS_
* `aspectRatio` Float - The aspect ratio to maintain for some portion of the
@ -878,6 +882,12 @@ the supplied bounds.
Returns [`Rectangle`](structures/rectangle.md)
#### `win.getNormalBounds()`
Returns [`Rectangle`](structures/rectangle.md) - Contains the window bounds of the normal state
**Note:** whatever the current state of the window : maximized, minimized or in fullscreen, this function always returns the position and size of the window in normal state. In normal state, getBounds and getNormalBounds returns the same [`Rectangle`](structures/rectangle.md).
#### `win.setEnabled(enable)`
* `enable` Boolean