Fix root CopyArea IncludeInferiors screenshots#76
Conversation
Signed-off-by: April Grimoire <april@aprilg.moe>
|
Thx for this PR, but I think this is sourcing from the wrong place. CopyArea(src=root) should read the composited scanout — same as root GetImage (read_scanout_region(.., OnScreenOnly), backend.rs:14434) — not re-composite window storage. That way it matches what's actually on screen (alpha, cursor-policy, clipping) for free and drops all the walk/painter's-order code. Only wrinkle: select_scanout_bo_for_rect is single-output, so multi-head needs a per-output tile loop. |
|
But reading from the BO only makes sense for the root window. Otherwise it might be semantically incorrect: if I call 'copy_area', I don't want there to be shadowing caused by non-descendants. Anyway please treat this as an issue: currently flameshot doesn't work, and it might be used to report issues, so it not working can be annoying. |
|
ok, I'll have a look. |
|
Which version of flameshot did you try? On my system (arch) it ALWAYS tries to go via portal, and never native X11. On my system, flameshot even fails on Xorg on mate/awesome. |
|
ok, with flameshot 0.10 I can reproduce the issue. |
Flameshot on Awesome was only capturing the wallpaper instead of the full desktop. Its screenshot path uses
CopyArea(src=root, dst=pixmap)with a GC set toIncludeInferiors, but the v2 backend treated the root source as plain root storage, so mapped windows never made it into the destination pixmap.This commit fixes that path by copying the root base first, then overlaying mapped top-level windows and descendants in scene order. That makes Flameshot/Qt root-window screenshots include the visible desktop instead of just the background.
I checked it locally with:
cargo +nightly fmt --checkcargo clippy --all-targets -- -D warningscargo test --all-targets