Custom cursors are still missing some refinements. #### Known Issues - [x] On Web, correctly handle multiple windows waiting on the same cursor: #3321. - [x] On Wayland, account for alpha: #3360. - [ ] Figure out how to prevent `CustomCursor`s to outlive the event loop. This is similar to #3317 and #3258. #### Improvements - [x] Add back `Window::set_cursor_icon()` as a deprecated method: #3329. - [x] Merge icons and cursors in one type and one method: https://github.com/rust-windowing/winit/pull/3308. - [x] Add a cursor getter/setter on `WindowBuilder`: #3319. - [ ] Add a cursor getter on `Window`. - [ ] Make sure implementations check if the new cursor being set isn't the same already set. - [x] MacOS: #3324. - [ ] Wayland - [x] Web: #3321. - [ ] Windows - [ ] X11 - [ ] Return a `Result` at `CustomCursorBuilder::build()`, AFAIK only Windows needs it. - [ ] On Windows, extension method to load from a resource, like in [`Icon::from_resource()`](https://docs.rs/winit/0.29.6/x86_64-pc-windows-msvc/winit/platform/windows/trait.IconExtWindows.html#tymethod.from_resource). - [x] On Web, `async fn build()` extension method to wait until the cursor has successfully finished loading: #3384. #### Caching - [x] MacOS: #3291 - [ ] Wayland - [x] Web: #3276 - [x] Windows: #3293 - [x] X11: #3366 #### Animation - [x] Web: #3384 - [ ] Windows: support ANI files (loaded from memory or otherwise). - [ ] MacOS: Use `NSTimer`? (idea from [Firefox](https://source.chromium.org/chromium/chromium/src/+/25cbdb930951c1b8b7863351c45c340fcc95fcc4:ui/base/cocoa/cursor_utils.mm;l=275-285;bpv=0;bpt=0)) - [ ] X11: `XcursorAnimate`
Custom cursors are still missing some refinements.
Known Issues
CustomCursors to outlive the event loop. This is similar toWindowHandleis not sound #3317 andMonitorHandleandVideoModecan become invalid leading to panics #3258.Improvements
Window::set_cursor_icon()as a deprecated method: Add deprecatedWindow::set_cursor_icon()#3329.Window::set_cursor_icon()andWindow::set_custom_cursor()#3308.WindowBuilder: AddWindowBuilder::with_cursor()#3319.Window.ResultatCustomCursorBuilder::build(), AFAIK only Windows needs it.Icon::from_resource().async fn build()extension method to wait until the cursor has successfully finished loading: Web: improve custom cursor handling and add animated cursors #3384.Caching
Animation
NSTimer? (idea from Firefox)XcursorAnimate