Skip to content

v0.1.0.3

Latest

Choose a tag to compare

@github-actions github-actions released this 02 Aug 01:59
· 4 commits to main since this release
Fix screenshot() capturing a blank image on desktop

Compose Desktop renders through Skia directly to its own GPU/software
surface, bypassing the standard AWT/Swing paint chain entirely.
Component.paint() into an off-screen BufferedImage only ever saw whatever
a plain Swing repaint would draw — the background fill, never Skia's
actual content — so every screenshot came back visually empty.

Robot.createScreenCapture was tried as an alternative and rejected: it
reads real screen pixels, which requires an actual mapped, unoccluded
window and X11 permission, and failed outright in this sandbox with
"Screen Capture in the selected area was not allowed" — confirming the
original code comment's concern about environment fragility.

The actual fix: SkiaLayer.screenshot(), Skia's own in-process capture of
what it rendered, found by walking the window's component tree (mirroring
the existing inputTargetComponent pattern) since ComposeWindow doesn't
otherwise expose it. Verified end to end: the captured PNG now shows the
sample app's real UI instead of a flat fafafa fill.