Summary
Add an API to launch a perry/ui window in the maximized (or fullscreen) state, instead of the explicit width/height it currently requires. Requested for Windows in discussion #1232, but should work cross-platform.
Current state
The window-creation API only accepts a fixed size:
- Windows backend (
crates/perry-ui-windows/src/ffi/app_window.rs): perry_ui_app_create(title, width, height) + set_size / set_min_size / set_max_size.
- macOS backend (
crates/perry-ui-macos/src/lib_ffi/window_misc.rs): mirrors the same surface.
Searching the workspace for maximize, maximized, zoom, fullscreen, SW_MAXIMIZE, WS_MAXIMIZE, showMaximized, windowState returns no hits — there is no programmatic way to start maximized today. The Win32 backend already uses ShowWindow but never with SW_MAXIMIZE/SW_SHOWMAXIMIZED.
Proposed shape
TypeScript-side, something like:
const app = createApp({
title: "My App",
windowState: "maximized", // "normal" (default) | "maximized" | "fullscreen"
});
Behind the scenes:
- Windows: call
ShowWindow(hwnd, SW_SHOWMAXIMIZED) on first show (or fullscreen via removing WS_OVERLAPPEDWINDOW and resizing to the monitor rect).
- macOS:
NSWindow.zoom(_:) for maximize / toggleFullScreen(_:) for fullscreen, called from the MainThreadMarker path.
- Linux/GTK4 (if in scope):
gtk_window_maximize / gtk_window_fullscreen.
Width/height should remain optional; if both are provided alongside windowState: "maximized", the maximized state wins on launch but the saved restore size honors them.
Linked discussion
Summary
Add an API to launch a
perry/uiwindow in the maximized (or fullscreen) state, instead of the explicitwidth/heightit currently requires. Requested for Windows in discussion #1232, but should work cross-platform.Current state
The window-creation API only accepts a fixed size:
crates/perry-ui-windows/src/ffi/app_window.rs):perry_ui_app_create(title, width, height)+set_size/set_min_size/set_max_size.crates/perry-ui-macos/src/lib_ffi/window_misc.rs): mirrors the same surface.Searching the workspace for
maximize,maximized,zoom,fullscreen,SW_MAXIMIZE,WS_MAXIMIZE,showMaximized,windowStatereturns no hits — there is no programmatic way to start maximized today. The Win32 backend already usesShowWindowbut never withSW_MAXIMIZE/SW_SHOWMAXIMIZED.Proposed shape
TypeScript-side, something like:
Behind the scenes:
ShowWindow(hwnd, SW_SHOWMAXIMIZED)on first show (or fullscreen via removingWS_OVERLAPPEDWINDOWand resizing to the monitor rect).NSWindow.zoom(_:)for maximize /toggleFullScreen(_:)for fullscreen, called from theMainThreadMarkerpath.gtk_window_maximize/gtk_window_fullscreen.Width/height should remain optional; if both are provided alongside
windowState: "maximized", the maximized state wins on launch but the saved restore size honors them.Linked discussion