Module winpos

Source
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Γ—h window so it sits fully inside area, 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.