Floating windows

Tools and documents float into real desktop windows on Windows, macOS and Linux (X11). The browser and mobile heads use in-surface floating hosts instead.

Caption

Every floating window draws its own caption, in the active theme's colors:

Element Tools Documents
Title Selected tool of a single-pane window Floating document
▾ Window position Tool menu (Float, Dock, Dock as Tabbed Document, Auto Hide, Hide) Document menu (Close, Close All But This, Close All, Float, Dock as Tabbed Document, New Horizontal/Vertical Tab Group) when the theme's FloatingDocumentMenuButton is True (every theme except Generic)
□ / ❐ Maximize / Restore Yes Yes
× Close Hides or closes the window's tools Closes the document

A floating tool window with a single pane shows its tool title only once: the pane's own title row is merged into the window caption. Windows with several panes keep a title row per pane. The caption has no minimize button; minimizing remains available from the system menu when the window's presenter allows it. Double-clicking the caption maximizes or restores the window; right-clicking it opens the system menu.

Caption and frame colors follow window activation through the theme keys ToolTitleBrush/ActiveToolTitleBrush, their foregrounds, the caption button keys (CaptionButtonForegroundBrush, ChromeButtonHover*), and FloatingBorderBrush/ActiveFloatingBorderBrush with FloatingBorderThickness (see Themes). The classic themes draw a 3–4 pixel frame that changes color when the window becomes active; Fluent and the automatic palette draw no frame of their own.

Tearing content off

With native floating windows, dragging behaves like a desktop IDE:

A document torn off its tab strip on Windows, following the pointer over the target pane's docking guides

Set DockingManager.ContinuousTearOff = false to keep drags inside the workspace; content then floats only when released outside the window. In-surface floating hosts always use that release behavior.

The window opens with the size of the pane it came from, placed so the pointer keeps its grip on the caption. FloatingLeft, FloatingTop, FloatingWidth and FloatingHeight are persisted in top-left, Y-down device-independent pixels on every platform, so saved layouts reopen in the same place on Windows, macOS and Linux.

Size and placement

Applications can use the same desktop coordinate space for their own windows: DesktopWindowCoordinates.GetWorkAreas(element), DesktopWindowCoordinates.SetWindowBounds(window, bounds, scale) and coordinates.ToDesktopPoint(element, point) all use top-left DIPs.

On Windows each monitor keeps its own scale (mixed DPI). A monitor's DIP rectangle starts at its physical origin and is sized by its own scale, so a window's bounds convert through the monitor it is on: saved bounds reopen on the same monitor at the same physical place and size, a single monitor at the desktop origin maps as pixels ÷ scale, and monitors never overlap in DIPs. macOS uses AppKit points and Linux the host's single scale. The per-monitor conversion is covered by unit tests (DesktopDipSpaceTests). The window-placement suite also checks it end to end on Windows, pairing the real monitor with a second one at a different scale: real windows land on the physical pixels that monitor's scale requires, and a native move there is saved back in its DIPs. The single-monitor path runs in the desktop suites at 100% and 200%.

Floating tool and document windows under Openbox on Linux

Platform notes

Virtual machines without a working GPU driver can run the Gallery with UNODOCK_SOFTWARE_RENDERING=1 to select Skia's software rasterizer.