stalepaintprobe

command
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2026 License: BSD-3-Clause Imports: 16 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command stalepaintprobe checks #864: a change made just after a window's content is built, before or around its first paint, must reach the screen.

It builds a window with a red rectangle and a short label, and from a goroutine started at build turns the rectangle green and lengthens the label. 2.5 s later it reads back the last frame the window presented, armed before the first paint so nothing forces a repaint, and prints

CHANGE at=... rect-canvas=... label-canvas=... frames=N
RESULT ... rect=green(ok)|red(STALE) label-ink-width=W frames=N

label-ink-width is how far right the label's text reaches: 154 for the long text on macOS at 1x, 85 for the short one. Run with no change at all (DELAY_MS=100000) as the control: it must print red(STALE) and the short width, which shows the read-back is the presented frame.

Environment: DELAY_MS before the change; HOP=runonmain to hop with bellui.RunOnMain instead of bellui.Do; MODE=swap to build into a window already shown; SHAPE=stack for Bellui Player's AudioPlayer shape (a widget over a Stack whose child is replaced, then both refreshed).

HIDE=1 (macOS) is the case that lost the change (#864): the app is hidden 300 ms after the start, so the window can't paint, and brought back to the front at 3 s. Give the change a DELAY_MS between the two, such as 1500. The read-back then waits until 5.5 s. It needs System Events (Accessibility) and does not raise the window if another app takes the front meanwhile, so the probe then forces a repaint after the read-back and prints whether a frame began: repaint-began=false means the window was still covered and the run says nothing.

go run ./hack/stalepaintprobe
HIDE=1 DELAY_MS=1500 go run ./hack/stalepaintprobe

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL