Skip to main content

cursor_image_origin

Function cursor_image_origin 

Source
pub(crate) fn cursor_image_origin(
    x: i16,
    y: i16,
    xhot: u16,
    yhot: u16,
    cap_x: i32,
    cap_y: i32,
) -> (i32, i32)
Expand description

Frame-space top-left of the cursor image, given the XFixes hotspot position.

XFixes reports the cursor position at its HOTSPOT; X draws the image with its top-left at (pos - hot), and the capture origin (cap_x, cap_y) is subtracted to move it into frame space. The result may go negative near the frame edges, which overlay_cursor clips per pixel to match the server’s own edge clipping.