Expand description
Window placement: open on the monitor the user is actually on.
eframe persists the window rect and its stored position always wins over ViewportBuilder::position
(epi_integration applies WindowSettings::initialize_viewport_builder last), so without this the app
reopens on whichever monitor it was closed on. At startup we move the window onto the monitor under the
mouse cursor β keeping the persisted size, and keeping the persisted position when it is already on
that monitor (so a deliberate arrangement is never disturbed).
FunctionsΒ§
- contains π
- hwnd_of π
- place π
- New top-left for a
wΓhwindow so it sits fully insidearea, centred when it doesnβt already fit. - place_
on_ cursor_ monitor - Move the window onto the monitor under the cursor (no-op when it is already there, or on any error).
Call once, from
App::newβ before the first frame is painted, so there is no visible jump. - work_
area π - Work area (excludes the taskbar) of the monitor containing
p, in physical pixels.