← Back to Pull requests

[for JP] fix: event-driven frame loop, no idle RGB repaint, no disposed window-actor access #1

Open
unknown opened this pull request with 331 lines diff across 4 files
View on GitHub
unknown unknown commented on Sep 27, 2026 05:54 UTC
Author

[for JP]: do not merge without JP. This affects the live GNOME desktop.

Fork of Hati as hati-realm@jphein.github.io. It installs beside upstream and shares its settings.

Root causes (katana, 2026-09-26: gnome-shell ~55% of a core with the cursor still)


1. The perpetual 16 ms GLib tick. With JP's settings (rgb-enabled=true, size 200, glow 100), every tick repaints the Cairo canvas, including while auto-hide has faded it to opacity 0. Without RGB mode, upstream doesn't redraw at idle; it only runs the 60 Hz JS tick.
2. SceneCloner reads disposed window actors. Each clone kept _sourceActor until the next 500 ms rebuild, so a window closed in between was read from on every magnifier frame. This is the "MetaWindowActorWayland … already disposed" error at scene-cloner.js:90, reached through extension.js:179.

Fix


  • The frame loop is now a Clutter.Timeline on the stage frame clock. It runs only while something moves: physics not settled, a click animation, visible RGB, magnifier or spotlight on, or the auto-hide countdown. It wakes on the cursor tracker's position-invalidated, plus a 100 ms read-only pointer-mask watch for buttons and the magnifier/spotlight modifiers.

  • The RGB cycle pauses while auto-hidden.

  • Window clones drop themselves on their source actor's destroy, and every access is guarded.
  • Evidence


    tools/nested-test.sh runs a headless gnome-shell on its own session bus with temp XDG dirs; it never touches the live session. Each run measures 10 s idle.

    | run | ticks | frames | disposed errors |
    |---|---|---|---|
    | no extension | 9 | – | 0 |
    | upstream, rgb | 149 | 595 | 6–10 |
    | realm, rgb | 10–11 | 1 | 0 |
    | realm, rgb, auto-hide off (must still animate) | 156 | 594 | – |
    | perturb: never settle | 20 | 1 | – |
    | perturb: no destroy tracking | – | – | 8 |
    | perturb: rgb while hidden | 141 | 595 | – |

    The frames counter was validated against upstream's RGB mode. The disposed check first read 0 even with the fix removed, because the loop was asleep. It now wakes the loop after forcing the magnifier on.

    Swap (JP, when he chooses; Wayland may need a logout/login before a new UUID loads)


    gnome-extensions disable hati@szymonwilczek.github.io
    gnome-extensions enable hati-realm@jphein.github.io
    

    Back out: gnome-extensions disable hati-realm@jphein.github.io && gnome-extensions enable hati@szymonwilczek.github.io.

    Already installed (make install), not enabled. After the swap, the live gain still needs measuring: sample gnome-shell over 10 s with the cursor still.

    🤖 Generated with Claude Code

    Diff: 331 lines (+248 / -83) across 4 files Reviewer: copilot-pull-request-reviewer[bot] Review duration: 0m
    All Vouch review confidence checks passed
    Residual risk 0.42 = Change Risk (0.47) × (1 − Review Confidence (0.11)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.47 · 331 lines diff across 4 files
    0.47
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 8% · Reviewer familiarity: 35%
    11%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.347
    Shallow Review Depth shallow_review_depth
    0.344
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #1"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: medium confidence: 11.2% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 47.1% (MEDIUM) · Higher = larger blast radius
    47.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 11.2% · Lower = rushed or shallow review
    11.2%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 41.8% · Moderate risk
    41.8%
    Repository