mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-22 15:25:46 +00:00
73a04e4c00
The mini player window persists its top-left position to `mini_player_pos.json` and re-applies it on every open. With multiple monitors that breaks in three failure modes: - Second monitor not yet enumerated when the window opens for the day (hot-plug detection race during early boot, especially on Windows). - Monitor reorder / resolution change since the last save. - Monitor unplugged. In all three the saved coords land in the void and the window appears off-screen. Validate the persisted position against `available_monitors()` before applying it: require the saved top-left plus an 80 px corner to fit inside any current monitor. If not, fall back to `default_mini_position` (bottom-right of the main window's monitor). The persisted file is left untouched so the position comes back the next time the missing monitor is present again. Validation runs in both `build_mini_player_window` (initial creation) and `open_mini_player` (re-show, where Linux WMs may re-centre).