Skip to content

fix(paint): keep copying unchanged subtrees while a modal is open - #2667

Merged
Hona merged 1 commit into
devfrom
fix/paint-keep-modal
Nov 27, 2026
Merged

Hona merged 1 commit into
devfrom
fix/paint-keep-modal

Conversation

@Hona

@Hona Hona commented Nov 27, 2026

Copy link
Copy Markdown
Member

Summary

  • Allow PaintKeep while a modal is open: removed self.kbd.modal_scope.is_none() from shareable in RuntimeCore::keep_begin (crates/rune/src/runtime/paint/keep.rs) so unchanged background subtrees (built with memo or region_with) and unchanged modal subtrees keep copying their paint output across edits, animations, and unchanged frames while a modal is open.
  • Encode per-node modal membership in own_key: folded rt.modal_member(i) into own_key so opening, closing, or nesting a modal invalidates any node whose modal membership changed on that frame—clearing background hit registrations behind a modal and restoring them on close without stale hits.
  • Tighten related paint-keep soundness: hashed self.kbd.focus.entered_by_keys() in keep_begin's shared key (matching focus_within_ring) and excluded El::help_open nodes in static_ok so HitState::help_held is preserved across kept frames.

Verification

  • cargo check -p rune passed.
  • cargo test -p rune --lib "paint::keep::tests" passed (7/7), including two new headless tests verifying memo and region_with background reuse during edits inside an open modal, background mutations under a modal, backdrop_blur, modal movement, nested modals, entrance/exit fades, strict debug keep_check (0 mismatches), and release-mode force_copy byte-for-byte parity with fresh unskipped paints (instances, hits, wheel_hits, overlay_hits, help_hits, drop_hits, drawn, seen).
  • Ran runtime::paint::, runtime::input::help::tests, runtime::input::hit::tests, runtime::input::focus::, and modal test suites under RUNE_PAINT_KEEP_STRICT=1 with zero PaintKeep mismatches.
  • Not run locally: real GPU presentation / --profile perf Linux benchmark from the issue.

Fixes #2652

@Hona
Hona merged commit a1f39c7 into dev Nov 27, 2026
4 checks passed
@Hona
Hona deleted the fix/paint-keep-modal branch November 27, 2026 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Paint keep is off for the whole window while a modal is open: an edit in a dialog copies 0 of 7,027 nodes, and memo/region_with save about half as much

1 participant