From 60385d062ad13c02d614d042d1021f4619bfadaf Mon Sep 17 00:00:00 2001 From: en Date: Wed, 16 Sep 2026 17:33:25 +0200 Subject: [PATCH] toplevel_export: capture_via_export docstring contradiction (Grok round 3 #11) The docstring simultaneously claimed the function writes a synthetic PNG-sized byte slice and that a real pixel read runs end-to-end via gbm_runtime. Rewritten to be consistent with what the function actually does today: real RGBA8 pixel read via gbm_runtime on success, synthetic-frame fallback on any libgbm/format failure. cargo test 99+/0; clippy clean. --- src/toplevel_export.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/toplevel_export.rs b/src/toplevel_export.rs index 771b7c7..78bee61 100644 --- a/src/toplevel_export.rs +++ b/src/toplevel_export.rs @@ -218,14 +218,12 @@ pub async fn capture_via_export_for( capture_with_state(conn, manager, output, dest, event_queue).await } -/// Public entry: the dmabuf path of `capture_toplevel`. Connects to +/// Public entry: the dmabuf path of capture_toplevel. Connects to /// Wayland, requests an export against the requested output, waits for -/// the `frame` + per-plane `object` + `ready` events, then **without** -/// calling gbm writes a synthetic PNG-sized byte slice to `dest`. The -/// synthetic frame proves the protocol round-trip end-to-end; a real -/// pixel read runs end-to-end via `crate::gbm_runtime` (Bug #9 -/// closed; commit `0ba3c59`). On any libgbm/format failure the -/// synthetic-frame fallback runs. +/// the frame + per-plane object + ready events, then writes real RGBA8 +/// pixels to dest via gbm_runtime (Bug #9 closed; commit 0ba3c59). +/// On any libgbm/format failure the synthetic-frame fallback runs so +/// the caller always sees the round-trip metadata. pub async fn capture_via_export( output: &wl_output::WlOutput, dest: &Path,