ui-contract: a repaint request's cause names its caller

repaint::request and request_of are #[track_caller], so egui's repaint causes
name the component that asked, not the wrapper: how the hover fades that
keep frames running were found (photocraft#17148).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
David MannandClaude Opus 5.5 committed 2026-11-27 00:09:55 +01:00
1 parent bd2e084232
commit cbcc2ffbdb
1 file changed
+4 -2
@@ -2,13 +2,15 @@
use egui::Context;
/// Asks for one more pass after this one.
/// Asks for one more pass after this one. The repaint cause names the caller.
#[track_caller]
pub(crate) fn request(ctx: &Context) {
crate::runtime::replay::note_unsettled(ctx);
ctx.request_repaint();
}
/// Asks for a pass of `viewport` at once.
/// Asks for a pass of `viewport` at once. The repaint cause names the caller.
#[track_caller]
pub(crate) fn request_of(ctx: &Context, viewport: egui::ViewportId) {
crate::runtime::replay::note_unsettled(ctx);
ctx.request_repaint_of(viewport);