Skip to main content

Module native_view

Module native_view 

Source
Expand description

Where a window’s platform views are made: the handle the Renderer reports for each window that holds a NativeView.

A platform view (a web view, a video surface, a map) is made by the application, or by a crate it uses, against the window it will sit in: an NSView is made for the window’s content view, a child HWND for the top-level window. Only the Renderer knows those, so it reports one NativeViewParent per window once a NativeView is in it, again when the handle or the backing scale changes, and with a zero handle when the window closes. This module keeps the last report of each window for the code that makes the views.

The view is then handed over with ui::NativeView (or Batch::attach_native_view) and stays the application’s: the Renderer places it and never destroys it.

Structs§

NativeParent
What one window reported about the handle its platform views are made against.
NativeParentSubscription
A registration for parent reports. Dropping it ends the registration.

Functions§

native_parent
The last report for window (0 for the single window), or None before there is one. A window that closed reports a zero handle, which is returned as it came.
native_parents
Every window’s last report, in the order they first reported.
subscribe_native_parent
Registers notify to be called each time a window reports a different parent.