class MenuHost
Swift
final class MenuHost
App-level menubar owner: retains MenuController and the active backend.
Backend selection (once at init, unless LAVA_MENU forces):
LAVA_MENU=vulkan → always in-window
LAVA_MENU=dbus → try DBusMenu, else vulkan
(unset / auto) → DBusMenu if registrar + X11, else vulkan
Sources/LavaUI/MenuHost.swift:21
Constructors
init(editor: Editor)
Not documented.
Sources/LavaUI/MenuHost.swift:37
Properties
var backend: MenuBackendKind { get }
Not documented.
Sources/LavaUI/MenuHost.swift:33
static let barHeight: Float
Default strip height in layout pixels (Vulkan backend only).
Sources/LavaUI/MenuHost.swift:131
let controller: MenuController
Not documented.
Sources/LavaUI/MenuHost.swift:32
static let dbusPumpInterval: Double
Cap for pumpEvents idle wait while a global menu is exported (seconds).
Sources/LavaUI/MenuHost.swift:62
nonisolated(unsafe) static var exportWindowId: UInt32
The id to register this app's menu under, when the window is not an X11 one and has no id of its own to offer.
Set by LavaClient to the compositor's surface id, before the first
MenuHost exists. That number is what the compositor reports as
focused, so it is the one a panel can match a menu to — and without it
a client's menu could be exported but never found, which is why a
client used to fall back to drawing its own strip.
Sources/LavaUI/MenuHost.swift:30
var isEmpty: Bool { get }
Not documented.
Sources/LavaUI/MenuHost.swift:128
var model: MenuModel { get }
Not documented.
Sources/LavaUI/MenuHost.swift:126
var needsDBusPump: Bool { get }
DBusMenu replies (GetLayout / AboutToShow / Event) only run when the
GLib main context is iterated. The panel blocks on those calls — if we
sit forever in glfwWaitEvents without pumping GLib, XFCE freezes.
Sources/LavaUI/MenuHost.swift:59
var showsInWindowChrome: Bool { get }
Whether the in-window MenuChromeRoot strip should be composed.
Sources/LavaUI/MenuHost.swift:52
Methods
@discardableResult func activate(_ id: MenuID) -> Bool
Not documented.
Sources/LavaUI/MenuHost.swift:88
@discardableResult func activate(matchingKey key: Int32, mods: Int32) -> Bool
Not documented.
Sources/LavaUI/MenuHost.swift:97
func poll()
Pump GLib/DBus and run any panel activations. Call once per frame.
Sources/LavaUI/MenuHost.swift:116
@discardableResult func update(_ bar: MenuBar) -> Bool
Rebuild IR from a menubar description. Pushes to DBus when that backend is active. Returns whether the platform-facing model changed.
Sources/LavaUI/MenuHost.swift:67
@discardableResult func update(@MenuBarBuilder _ content: () -> [Menu]) -> Bool
Not documented.
Sources/LavaUI/MenuHost.swift:83