You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.