Skip to main content

Module embed

Module embed 

Source
Expand description

Embed a plugin editor inside a host window (e.g. an egui/eframe window), as an alternative to the standalone PluginWindow.

Instead of opening its own top-level OS window, the plugin’s native editor view is parented as a child of a window your UI framework already owns, positioned to track a region you allocate. You provide the parent window’s RawWindowHandle and a target rectangle (in logical points, top-left origin — the egui convention) each frame.

Implemented on macOS (verified), Windows, and Linux/X11. A Wayland RawWindowHandle is rejected explicitly: VST 3.8 requires the host to provide a compositor connection through IWaylandHost, not merely pass the application’s system-compositor wl_surface. Other platforms return an error from EmbeddedEditor::embed. Requires the egui-widgets feature.

Sizing goes both ways. The host proposes a size through EmbeddedEditor::set_rect and the plugin may adjust or refuse it; the plugin proposes one through EmbeddedEditor::take_resize_request, which the host should poll each frame and answer by allocating that much space.

On Windows the parent window and its message loop remain owned by the UI framework, so this type cannot intercept WM_DPICHANGED. Forward framework scale-factor changes explicitly with Plugin::set_editor_scale_factor; the initial child DPI is communicated automatically when embedding.

Structs§

EditorRect
A rectangle in the host view’s logical points, top-left origin (egui convention).
EmbeddedEditor
A plugin editor embedded into a host window. Drop it (or call Self::close) to detach the editor and remove the child view.