Skip to main content

Module native

Module native 

Source
Expand description

Optional AppKit chrome and material hosting for macOS windows.

Navigation underlays expose system material through transparent GPUI regions. Anchored popup factories use separate GPUI windows with an AppKit glass content view, so the material can sample the owning window’s rendered canvas.

For native chrome, set WindowOptions::window_background to gpui_kit::WindowBackgroundAppearance::Transparent. GPUI’s Blurred mode adds a separate selection-material backdrop that changes the appearance of native glass layered above it.

Structs§

GlassPanel
A GPUI root wrapping retained application content, never frame-local AnyElement values. Its own window draws the foreground over native glass.
GlassPanelHandle
Keep this handle while a glass popup is open. Content remains an ordinary retained GPUI entity and can be updated normally by the application.
GlassPanelOptions
Geometry and material for a popup above its owning GPUI window.
NativeGlass
A system glass underlay with GPUI-owned content, layout and interactions.
NativeGlassPopup
Owns the native contentView installation and child-window attachment. Keep it in the popup’s root entity. Dropping it restores the preceding hierarchy and removes the child attachment without changing GPUI delegates.
NativeToolbarHandle
Keep this handle in the application’s window view for the toolbar lifetime. Dropping it restores the window’s preceding toolbar and title treatment.
SidebarMetrics
AppKit source-list dimensions in logical points. Native rows follow the system sidebar size preference; portable/headless views use the regular size.

Enums§

NativeToolbarItem
A real NSToolbar command with native SF Symbols artwork and accessibility.

Functions§

glass_available
Whether a real NSGlassEffectView can be hosted in this desktop window. Returns false off macOS, in headless windows, and before macOS 26.
install_glass_popup
Wrap a GPUI-created popup’s own renderer in real system glass.
install_glass_popup_presenter
Install real glass presentation for Base popup factories. Ordinary inline presentation remains automatic off macOS, in headless tests, on older systems, and when reduced transparency is selected.
install_native_toolbar
Install an actual unified AppKit toolbar on the existing GPUI NSWindow.
is_glass_popup
Whether this window’s foreground renderer is hosted in a real glass popup. Surface adapters can leave their backgrounds clear in this presentation.
native_glass
Start a real system glass surface where supported, with a themed fallback.
native_toolbar_inset
The area at the top of the GPUI renderer covered by native window chrome. Returns zero when AppKit already excludes that area or no handle exists.
observe_activation
Observe this window’s real activation state without replacing its delegate. Keep the subscription on the view, or detach it for that view’s lifetime.
open_glass_panel
Open a GPUI foreground panel over a system glass backdrop.
sidebar_inactive_selection
The selected-row tint in an inactive source list. Ordinary AppKit source lists use vibrant material paint, not the opaque generic selection color. Accessibility modes use the system’s opaque semantic selection instead.
sidebar_metrics
Read the system’s default source-list row size without allocating a view for every row. Call crate::refresh_accessibility after changing settings.