Window menu requests
Gnoblin reports window-menu requests to the active shell. The shell draws the menu as its own Wayland surface and chooses which actions to show.
Subscribe to gnoblin.window.menu-requested through the
compositor bridge.
The event includes:
window_id: stable ID of the window that requested the menu;menu_type:wmfor a window-manager menu orappfor an application menu;xandy: requested menu position in global logical coordinates.
For a window-manager menu, a Lua callback receives a grant in event.grant. Use it with
window:begin_move(event.grant) or window:begin_resize(edge, event.grant) on event.grant.window if the shell
offers those actions.
A socket client receives a one-use menu_context token in the same event, and sends it with window.begin_move or
window.begin_resize. API 1.30 added it.
The grant and the token are tied to the requesting window and expire after five seconds. A session lock revokes
both, and a disconnect also revokes a socket token. Application menu requests are informational and do not include
this capability. See the menu action details.
Use the supplied window_id for other window operations; do not target the
focused window after the menu opens. Read the live window record to
check which actions are available, then send the corresponding typed
operation through the bridge. Gnoblin rechecks the window and session state
when it applies the operation.