Window API
Declared by <huxerui/window.h>.
Configuration enums
Section titled “Configuration enums”WindowContentMode:SafeArea,EdgeToEdge.WindowChromeMode:System,Custom.WindowLifecycleState:Active,Inactive,Background, for this window independently of aggregate application state.WindowCommand:Show,Hide,Activate,Minimize,Maximize,Restore,ToggleMaximize,Close.SystemBarContentBrightness:Automatic,Light,Dark.
Options and metrics
Section titled “Options and metrics”WindowOptions: title, initial size, optional minimum client size, content mode, chrome mode, preferred title-bar height, and caption labels.WindowCaptionLabels: localized minimize, toggle-maximize, and close labels.WindowMetrics: logical viewport, remaining safe-area insets, and optional title-bar metrics.WindowTitleBarMetrics: height, resolved left/right control reservations, and maximized state.
Modifiers
Section titled “Modifiers”SystemBarsAppearance: status/navigation backgrounds and content brightness;Default()andDescriptor().SafeAreaPadding: per-edge booleans andDescriptor(); selected edges consume only unconsumed ancestor insets.WindowDragRegion: marker descriptor for draggable custom-chrome content.
Title bar and commands
Section titled “Title bar and commands”WindowTitleBar is a variadic/collection Layout that applies drag-region and centered cross-axis behavior while reserving standard controls. UseWindow() -> WindowHandle; handle methods are Show, Hide, Activate, Minimize, Maximize, Restore, ToggleMaximize, and Close.
Lifetime and keyboard requests
Section titled “Lifetime and keyboard requests”WindowHandle::IsOpen observes whether its original window remains open. Hidden and minimized windows remain open; retired handles never attach to a replacement. LifecycleState and OnLifecycleChanged observe only that window. Observers are composition-bound and do not replay the current state.
ShowKeyboard requests the software keyboard for the focused editor. HideKeyboard dismisses it while preserving focus, selection and the editing session. Both run on the application thread and remain requests to the platform. TextInputConfiguration::keyboard_policy selects SoftwareKeyboardPolicy::Automatic or Manual.
UseApplication().OpenWindow creates a desktop window where SupportsMultipleWindows reports support. iOS and iPadOS use the asynchronous scene API instead. UseWindow requires the current original window context; an application-only callback has no default window. See application/window ownership.
Platform contract
Section titled “Platform contract”WindowOptions is read when the platform shell creates its window. Desktop options include transparent_background, always_on_top, activatable, pointer_pass_through, and resizable. Query ApplicationHandle::WindowSupport() first. WindowCapabilities::non_activating corresponds to requesting activatable = false. An unsupported option can cause OpenWindow() to fail.
IsFullscreen() observes the state confirmed by the host. SetFullscreen(bool) requests a change on the application thread. Completion can be asynchronous and the request can be refused. On Web, request entry directly from a user action. SetAlwaysOnTop(bool) and SetPointerPassThrough(bool) change supported desktop options on a live window and return whether the host accepted the change.
Use the platform handle API when a native integration needs the actual window object.
WindowMetrics is host-submitted observable geometry expressed in logical units.
SafeAreaPadding consumes only selected insets not already consumed by an ancestor, so nested safe-area containers do not double-pad content.
WindowContentMode::SafeArea asks the root to stay within platform insets; EdgeToEdge allows drawing behind system UI.
WindowChromeMode::Custom requires application title-bar content and is meaningful on desktop backends that support custom chrome.
Window commands are requests: embedded hosts and platforms without the corresponding operation may ignore them.
OnCloseRequest(handler, dependencies...) and OnMinimizeRequest(...) register lifecycle-bound policy. Return true to consume a request and false to allow the platform default. Use these for unsaved-work confirmation or an explicitly available tray workflow, not to maintain a second window state model.

