WindowManager
Manager controlling floating window z-order, focus stack, active states, and desktop window arrangements.
Overview
WindowManager controls the lifecycle, z-ordering, focus stacking, and spatial positioning of floating desktop windows inside an OverlayLayer.
Key responsibilities:
- Window registration, activation, and focus management.
- Z-order stacking with bringToFront and sendToBack.
- Modal dialog stacking, preventing interaction with lower windows until the modal dialog is dismissed.
- Active window queries and window hierarchy iteration.
Managing Floating Windows
Related links
- OverlayLayer: Full-screen overlay root managing modal backdrops, dialogs, popups, and layer-based hit testing.
- WindowWidget: Desktop-style floating window widget supporting title bar, dragging, resizing, collapse, modal dialogs, and docking integrations.
API
WindowManager::activate(WindowWidget)
Activates the specified window, brings it to front, and grants keyboard focus.
| Parameter | Type | Description |
|---|---|---|
window |
WindowWidget |
Window widget instance. |
Returns WindowManager: This widget instance for chaining..
WindowManager::activeWindow()
Returns the currently active focused WindowWidget, or null if none.
Returns WindowWidget: The currently active focused window, or null if none..
WindowManager::bringToFront(WindowWidget)
Brings the specified window to the top of its Z-order layer.
| Parameter | Type | Description |
|---|---|---|
window |
WindowWidget |
Window widget instance. |
Returns WindowManager: This widget instance for chaining..
WindowManager::host()
Returns the host OverlayLayer containing the managed floating windows.
Returns OverlayLayer: The host OverlayLayer containing managed windows..
WindowManager::modalStackDepth()
Returns the current number of open modal windows in the stack.
Returns int: The number of active modal dialogs in the modal stack..
WindowManager::register(WindowWidget)
Registers a window with this manager and associates it with the overlay host.
| Parameter | Type | Description |
|---|---|---|
window |
WindowWidget |
Window widget instance. |
Returns WindowManager: This widget instance for chaining..
WindowManager::registered(WindowWidget)
Checks whether the specified window is registered in this manager.
| Parameter | Type | Description |
|---|---|---|
window |
WindowWidget |
Window widget instance. |
Returns boolean: True if the window is currently registered with this manager..
WindowManager::topModalWindow()
Returns the topmost open modal window, or null if no modal windows are open.
Returns WindowWidget: The topmost active modal window, or null if no modal dialog is open..
WindowManager::unregister(WindowWidget)
Unregisters a window and activates the next topmost window if needed.
| Parameter | Type | Description |
|---|---|---|
window |
WindowWidget |
Window widget instance. |
Returns WindowManager: This widget instance for chaining..
WindowManager::windows()
Returns an unmodifiable list of all registered window instances.
Returns List: Unmodifiable list of all registered window widgets..