Skip to catalogue

226

window state

also window bounds, multi-monitor

Remember where the window was. If that display is gone, open it on a display that exists.

What is window state?

Window state is position, size, and whether it was maximized or full screen, stored per display. Restoring a coordinate from an unplugged monitor puts the window off-screen. The user thinks the app did not start.

Why does window state matter when vibe coding?

The draft saves x and y and restores them blindly. After a laptop undocks, the window is on a display that is not there. There is no menu command that can find it.

How do you do window state?

Save bounds on move and resize. On launch, intersect them with the current displays. If they miss, use a default on the primary display. Do not persist a maximized size as a normal width.

How do you ask a model for window state?

Restore the window bounds for (app). If the saved display is gone, open on the primary display at a default size. Do not restore an off-screen window.

What goes wrong with window state?

Saving state on every mousemove without a debounce, and writing a file on the UI thread.

adjacent