A cursor painted into the egui scene is composited with the frame, so it
always trails the pointer by a frame or more. This adds a path to hand a
cursor image to the windowing system instead, where the compositor draws
it with no lag.
- egui: PlatformOutput::cursor_image + Context::set_cursor_image().
CursorImage carries an id alongside the pixels so backends can detect
"same cursor as last frame" without hashing or comparing the buffer.
- egui-winit: handle_platform_output() stashes the image;
State::apply_pending_cursor_image() builds the winit CustomCursor and
applies it. The split is necessary because winit only creates custom
cursors from an ActiveEventLoop, which handle_platform_output has no
access to. Rebuilds only when the id changes, and suppresses
set_cursor_icon while a custom cursor is active so the two don't fight.
- eframe (wgpu): run_ui_and_paint already had the ActiveEventLoop and
simply wasn't passing it down; now it does, and applies the cursor.
- eframe (web): ignore the new field for now; the web backend could
express it as a CSS `cursor: url(...)`.
Supported by winit on X11, Wayland, Windows, macOS and Web. The glow
backend compiles unchanged but does not apply cursor images yet.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>