Skip to main content

platform_view

Function platform_view 

Source
pub fn platform_view(handle: PlatformViewHandle) -> PlatformView
Expand description

Hosts a native platform view — an NSView on macOS or a child HWND on Windows — inside the window, at the bounds this element is laid out at.

The element itself paints nothing. Size it the way you would size any other element; GPUI owns the native view’s frame from then on and repositions it after every frame it is painted in. A frame that does not paint the element hides and detaches the view, so unmounting is just not rendering it.

§Stacking

The hosted view is ordered above GPUI’s root scene. Content drawn on that same base surface does not composite over the native view. When the window’s scene overlay is enabled, deferred and window-level overlay content is drawn on a separate surface above hosted views.

§Platforms

macOS and Windows host native views. Elsewhere the element still lays out, reserves space, and does not host a view.