From 5da77b28b361c3c634b383a06298ecfdd123f376 Mon Sep 17 00:00:00 2001 From: en Date: Wed, 16 Sep 2026 08:04:14 +0200 Subject: [PATCH] capture_loop: honour ENBOXER_ENABLE_TOPLEVEL via capture_toplevel (Bug #8) Bug from Grok round-1 #8. capture_loop hard-coded grim and ignored the toplevel-export gate. If the operator set ENBOXER_ENABLE_TOPLEVEL=1 they got no effect at all -- the loop just kept grimming the source rect. Fix: when the gate is set, build a synthetic Client (the hit has only the source rect; pick_output_for queries live monitors to find one covering the rect) and try capture_toplevel first. On success show the frame; on failure fall through to grim so the operator at least sees the visible background rather than an empty frame. cargo test 96+/0; clippy clean. --- src/vfx.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/vfx.rs b/src/vfx.rs index 971fe76..17d10eb 100644 --- a/src/vfx.rs +++ b/src/vfx.rs @@ -330,6 +330,30 @@ pub async fn capture_loop(rx: watch::Receiver>, hub: Arc