utils/popoutBounds#
availableScreen()#
The area a popout can open in: the screen of the main window, less the taskbar or dock.
Returns#
The available width and height, zero when unknown.
height#
width#
clampBoundsToDisplays()#
Fit stored bounds onto the displays that actually exist right now.
Returns null when there is nothing sensible to restore (no bounds, no
displays, degenerate size) — callers then let the OS place the window, which
is always safe.
Parameters#
| Parameter | Type |
|---|---|
bounds |
PopoutBounds | undefined |
displays |
DisplayArea[] |
Returns#
PopoutBounds | null
fitSizeToScreen()#
Cap a popout's opening size to the screen it opens on.
Parameters#
| Parameter | Type | Description |
|---|---|---|
size |
{ height: number; width: number; } |
The panel's preferred size. |
size.height |
number |
- |
size.width |
number |
- |
screen |
{ height: number; width: number; } |
The available screen area; a zero side means unknown and leaves the size alone. |
screen.height |
number |
- |
screen.width |
number |
- |
Returns#
The size to open at.
height#
width#
DisplayArea#
A display work area, as reported by Electron's screen module.
Properties#
height#
width#
x#
y#
PopoutBounds#
Screen-space sanity for persisted popout window positions.
A popout remembers where the user put it. Monitors come and go — undocking a
laptop between sessions is routine — and a window restored onto a display
that no longer exists is unreachable: it has no visible title bar to drag and
no taskbar entry of its own. Every restore therefore goes through
clampBoundsToDisplays first.