fn create_empty_cursor(&self) -> Option<ffi::Cursor> {
        let data = 0;
        let pixmap = unsafe {
            (self.xconn.xlib.XCreateBitmapFromData)(self.xconn.display, self.xwindow, &data, 1, 1)
        };
        if pixmap == 0 {
            // Failed to allocate
            return None;
        }

        let cursor = unsafe {
            // We don't care about this color, since it only fills bytes
            // in the pixmap which are not 0 in the mask.
            let mut dummy_color = MaybeUninit::uninit();
            let cursor = (self.xconn.xlib.XCreatePixmapCursor)(
                self.xconn.display,
                pixmap,
                pixmap,
                dummy_color.as_mut_ptr(),
                dummy_color.as_mut_ptr(),
                0,
                0,
            );
            (self.xconn.xlib.XFreePixmap)(self.xconn.display, pixmap);
            cursor
        };
        Some(cursor)
    }
// TODO: This could maybe be cached. I don't think it's worth
// the complexity, since cursor changes are not so common,
// and this is just allocating a 1x1 pixmap...
This could maybe be cached. I don't think it's worth
the complexity, since cursor changes are not so common,
and this is just allocating a 1x1 pixmap
This could maybe be cached . I don ' t think it ' s worth the complexity since cursor changes are not so common and this is just allocating a 1x1 pixmap
fn create_empty_cursor(&self) -> Option<ffi::Cursor> {
        let data = 0;
        let pixmap = unsafe {
            (self.xconn.xlib.XCreateBitmapFromData)(self.xconn.display, self.xwindow, &data, 1, 1)
        };
        if pixmap == 0 {
            // Failed to allocate
            return None;
        }
        let cursor = unsafe {
            // We don't care about this color, since it only fills bytes
            // in the pixmap which are not 0 in the mask.
            let mut dummy_color = MaybeUninit::uninit();
            let cursor = (self.xconn.xlib.XCreatePixmapCursor)(
                self.xconn.display,
                pixmap,
                pixmap,
                dummy_color.as_mut_ptr(),
                dummy_color.as_mut_ptr(),
                0,
                0,
            );
            (self.xconn.xlib.XFreePixmap)(self.xconn.display, pixmap);
            cursor
        };
        Some(cursor)
    }
fn create_empty_cursor ( & self ) -> Option < ffi :: Cursor > { let data = 0 ; let pixmap = unsafe { ( self . xconn . xlib . XCreateBitmapFromData ) ( self . xconn . display , self . xwindow , & data , 1 , 1 ) } ; if pixmap == 0 { // Failed to allocate return None ; } let cursor = unsafe { // We don't care about this color, since it only fills bytes // in the pixmap which are not 0 in the mask. let mut dummy_color = MaybeUninit :: uninit ( ) ; let cursor = ( self . xconn . xlib . XCreatePixmapCursor ) ( self . xconn . display , pixmap , pixmap , dummy_color . as_mut_ptr ( ) , dummy_color . as_mut_ptr ( ) , 0 , 0 , ) ; ( self . xconn . xlib . XFreePixmap ) ( self . xconn . display , pixmap ) ; cursor } ; Some ( cursor ) }
TODO: This could maybe be cached.
TODO : This could maybe be cached .
&self
&self