Window System
OSSIM's window system provides a fully interactive desktop window experience including drag, resize, minimize, maximize, snap, tabbed hosting, and animated transitions.
Window Lifecycle
Spawning
Windows are created via WindowManager::SpawnWindow(ChromeClass, Params). Each window receives:
- A unique
FGuidwindow ID - Cascade positioning: Default position (100,100) offset by 30px × (
CascadeIndexmod 10) to prevent window stacking. - Z-order assignment via
GetNextZOrder().
States (EWindowState)
- Normal: Standard draggable/resizable window.
- Minimized: Window hidden from view, icon remains in taskbar.
- Maximized: Window fills the desktop work area.
Controls
- Close: Terminates the associated process via
ProcessManager::TerminateProcess. - Minimize: Hides the window with a scale/fade animation.
- Maximize: Expands to fill the desktop work area, hides taskbar overlay.
- Snap: Snap to half/full via
WindowManager::SnapWindow.
Window Widget (UWindowWidget)
Bind Points (all optional)
| Bind | Type | Purpose |
|---|---|---|
TitleText | UTextBlock | Window title display |
BodyContainer | UBorder | App content injection point |
TabBarContainer | UHorizontalBox | Tab buttons for multi-tab windows |
TabContentSwitcher | UWidgetSwitcher | Tab content pages |
AddTabButton | UButton | "+" button for adding tabs |
CloseButton | UButton | Window close |
MaximizeButton | UButton | Maximize/restore toggle |
MinimizeButton | UButton | Minimize to taskbar |
Interaction
- Drag: Click and drag the title bar.
- Resize: 8 directional edges/corners (
EResizeDirection). - Focus: Click anywhere on the window to bring to front.
- Double-click title: Toggle maximize.
- Min/Max size constraints:
MinSize=(200,150),MaxSize=(3840,2160).
Tabbed Hosting
Windows support hosting multiple app instances in tabs:
SupportsTabbedApps— Whether the window supports tabs.AddHostedTab(App, Content, Title)— Add a new tab.OpenAppInNewTab(AppClass)— Launch a new app instance in a tab.SwitchToHostedTab(ByPID)— Activate a specific tab.CloseHostedTab(ByPID)— Close a tab and terminate its process.RefreshHostedTabsUI()— Rebuild the tab bar.TerminateHostedApps()— Close all hosted tabs.
Tab Button Widget: UTabButtonWidget with bind points for MainTabButton, TabText, CloseButton.
Animations
Window transitions use FWidgetTransitionController:
enum EWidgetTransitionState { Hidden, Entering, Visible, Exiting }
FWidgetTransitionStyle defaults:
- Enter: 0.25s duration, ease exponent 3.0
- Exit: 0.2s duration, ease exponent 2.5
- Scale: Hidden=(0.95,0.95) → Visible=(1,1)
- Opacity: Hidden=0 → Visible=1
Window-Specific Animations
AnimateMinimize/AnimateRestore— Lerp to target position/size via Tick (AnimSpeed=20).
Window Container
UWindowContainerWidget hosts all windows on a UCanvasPanel. It subscribes to WindowManager::OnWindowOpened to add new windows to the canvas.
Taskbar Integration
The UTaskbarWidget maintains:
AppIconGroupMap<FString, UAppIconWidget*>— Groups windows by app.WindowToGroupMap<FGuid, FString>— Maps window IDs to app groups.MaximizedWindowIds: TSet— Tracks maximized windows to auto-hide the taskbar overlay.
Window Group Flyout
When an app has multiple windows, clicking its taskbar icon opens SWindowGroupFlyout — a Slate popup showing mock window chrome tiles with close buttons and live icon thumbnails.
