Skip to main content

position_window_top_right

Function position_window_top_right 

Source
pub fn position_window_top_right(
    window_width: i32,
    monitor: MonitorBounds,
) -> (i32, i32)
Expand description

Top-left position that anchors the popover’s top-right corner to the monitor’s top-right corner — flush against the screen edge, matching the macOS Control-Center / Notification-Center convention. The click position is only used by the caller to pick which monitor to anchor on; within that monitor the popover always lands top-right.

Returns top-left (x, y) in screen coordinates. macOS clamps the window’s titlebar below the menubar automatically when y falls in the menubar region, so passing monitor.y directly is safe.