Guide API
Skip to main content

activate_mouse

Function activate_mouse 

Source
pub fn activate_mouse(
    bar_id: ViewId,
    bar_menu: Menu,
    bar_bounds: Rect,
    owner_size: Point,
    mouse: MouseEvent,
    ctx: &mut Context<'_>,
)
Expand description

Open a menu session from the bar on a mouse press: push the session, then re-post the click so the session’s press arm processes it.

Unlike the hotkey activate, this opens no box up front: the re-posted click drives the session’s press arm (track to the clicked title, set auto_select) and the open gate, which yields the correct auto_select/last_target_item for the second-click-closes behaviour.

bar_menu is a clone of the bar’s menu; bar_bounds its bounds in the root frame (the bar is at (0,0), so the click delivered to handle_event is already root-frame); owner_size the root group size; mouse the click to re-post.