pub fn grab_pointer(&self, cursor: xproto::Cursor) -> Result<()> {
        xproto::grab_pointer(
            &self.conn,
            false,
            self.root,
            mouse_event_mask(),
            xproto::GrabMode::ASYNC,
            xproto::GrabMode::ASYNC,
            x11rb::NONE,
            cursor,
            x11rb::CURRENT_TIME,
        )?;
        Ok(())
    }
Grabs the cursor and sets its visual.
display-servers/x11rb-display-server/src/xwrap/mouse.rs