Skip to content

FPS indicator wakes up the renderer continuously when idle #23204

Closed

Description

@MartinZikmund

Current behavior

When DebugSettings.EnableFrameRateCounter is on and the app stops rendering, the FPS diagnostic panel is meant to do a single final redraw (showing "Idle" with the tinted background) and then go quiet. In practice the numeric values keep updating every couple of seconds, indicating the panel itself is waking the renderer continuously.

Expected behavior

After ~2 seconds of no external rendering, the panel should switch to the "Idle" state once and stay frozen there. No further wake-ups should occur until external activity resumes.

Root cause

Two compounding bugs in FpsHelper (src/Uno.UI/Helpers/SkiaRenderHelper.skia.cs):

  1. Bug A — first-idle-tick RequestRedraw sabotages idle detection. In the noNewFrames branch of TimerTick, a RequestRedraw?.Invoke() fired on every first idle tick. The resulting render flows through OnFrameRecorded, which bumps _currentFrameGeneration. The next tick observes the new generation, decides noNewFrames = false, and resets _consecutiveIdleTicks = 0. The counter never reaches 2, so true idle is never reached and the panel oscillates. (This line was a leftover from the original idle-indicator commit, where it was needed before the >= 2 early-return path was introduced.)

  2. Bug B — final idle redraw restarts the 1 Hz timer via BeginFrame. Even with Bug A fixed, the legitimate final idle redraw triggers a render that flows through Draw() -> RenderPicture() -> BeginFrame(). BeginFrame blindly restarts the timer because !_timerRunning. The next tick (immediate TimeSpan.Zero fire) sees the just-recorded idle frame's bumped generation, clears _isIdle, and the cycle restarts every 2-3 seconds.

Platforms

Skia (all Skia-based hosts).

Activity

  1. added a commit that references this issue on May 6, 2026
    12378cc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions