Skip to content

Fix root CopyArea IncludeInferiors screenshots#76

Closed
AprilGrimoire wants to merge 1 commit into
joske:masterfrom
AprilGrimoire:fix/root-copyarea-include-inferiors
Closed

Fix root CopyArea IncludeInferiors screenshots#76
AprilGrimoire wants to merge 1 commit into
joske:masterfrom
AprilGrimoire:fix/root-copyarea-include-inferiors

Conversation

@AprilGrimoire

@AprilGrimoire AprilGrimoire commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

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 to IncludeInferiors, 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 --check
  • cargo clippy --all-targets -- -D warnings
  • cargo test --all-targets

Signed-off-by: April Grimoire <april@aprilg.moe>
@joske

joske commented Jul 6, 2026

Copy link
Copy Markdown
Owner

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.

@AprilGrimoire

Copy link
Copy Markdown
Contributor Author

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.

@joske

joske commented Jul 6, 2026

Copy link
Copy Markdown
Owner

ok, I'll have a look.

@joske

joske commented Jul 6, 2026

Copy link
Copy Markdown
Owner

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.

@joske

joske commented Jul 6, 2026

Copy link
Copy Markdown
Owner

ok, with flameshot 0.10 I can reproduce the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants