Skip to content

fix(treeland): Print fullscreen capture latency and reliability - #879

Open
svan71 wants to merge 1 commit into
linuxdeepin:masterfrom
svan71:fix/treeland-print-fullscreen-latency
Open

fix(treeland): Print fullscreen capture latency and reliability#879
svan71 wants to merge 1 commit into
linuxdeepin:masterfrom
svan71:fix/treeland-print-fullscreen-latency

Conversation

@svan71

@svan71 svan71 commented Jul 21, 2026

Copy link
Copy Markdown

Summary

On Treeland, Print / FullscreenScreenshot was unreliable and felt slow:

  1. ~6s delay between file save and “Saved to …” toast
    save2Clipboard() busy-waits for dde-clipboard-daemon dataComing with a size-based timeout (6s at 2560×1440). On Treeland that handshake never completes, so the wait always burns the full timeout when clipboard runs around notify.

  2. Second Print often does nothing
    TreeLand is intentionally not isWaylandMode, so sendNotify / fullScreenshot used QTimer::singleShot(10, exitApp) and left the process in app->exec(), holding m_singleInstance.

  3. Empty / failed fullscreen grabs
    Legacy shotFullScreen() copies an unfilled m_backgroundPixmap on Treeland. This PR grabs each output noninteractively via ext-image-copy-capture-v1 (SHM), with full damage_buffer, display flush, 15s timeout, and one retry. Interactive initializeCapture is skipped for this path.

Changes

  • TreelandFullScreenGrabber + fullScreenshotTreeland() for noninteractive fullscreen
  • Skip clipboard-daemon wait when Utils::isTreelandMode
  • Immediate exitApp() when isTreelandMode (same as Wayland)
  • Flag m_treelandNonInteractiveFullscreen to stop selector init spam

Test plan

  • Treeland: press Print — Desktop JPEG appears and toast follows promptly (sub-second class, not multi-second stall)
  • Rapid double Print — two captures (or no silent long no-op while a zombie process holds the bus name)
  • Interactive region screenshot (Ctrl+Alt+A / dock) still works
  • X11 / non-Treeland paths unchanged (clipboard wait still used when not Treeland)

Notes

Verified live on Arch DDE + Treeland 0.8.15: compositor frame delivery ~20–40ms; delay was client-side. Pin-screenshots already skips blocking clipboard on Treeland; this aligns fullscreen with that approach.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @svan71, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: svan71

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@deepin-ci-robot

Copy link
Copy Markdown

Hi @svan71. Thanks for your PR.

I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@svan71
svan71 force-pushed the fix/treeland-print-fullscreen-latency branch from bf0b221 to ed64638 Compare July 23, 2026 21:19
@svan71

svan71 commented Jul 23, 2026

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@svan71
svan71 force-pushed the fix/treeland-print-fullscreen-latency branch from ed64638 to 9157e16 Compare July 23, 2026 21:20
@svan71

svan71 commented Jul 24, 2026

Copy link
Copy Markdown
Author

The red ✗ on cppcheck here is CI infrastructure, not this PR: actions/checkout recently began refusing fork-PR checkout in pull_request_target workflows, so cppcheck never actually runs (job dies at checkout in ~5s). Filed with details and suggested fixes: linuxdeepin/developer-center#13729

@deepin-bot

deepin-bot Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

TAG Bot

New tag: 6.6.38
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #887

On Treeland, Print/FullscreenScreenshot had three client-side problems:

1. save2Clipboard busy-waited for dde-clipboard-daemon dataComing with a
   size-based timeout (6s at 2560x1440). The handshake never completes, so
   the wait always burned the full timeout and delayed the "Saved to …"
   notification whenever clipboard ran before/near notify.

2. TreeLand is intentionally not isWaylandMode, so sendNotify/fullScreenshot
   used QTimer::singleShot(10, exitApp) plus app->exec(), leaving the
   process alive and making a second Print a silent m_singleInstance no-op.

3. Legacy shotFullScreen copies an empty m_backgroundPixmap on Treeland.
   Grab each output noninteractively via ext-image-copy-capture-v1 (SHM),
   with full damage_buffer, display flush, 15s timeout, and one retry.
   Skip interactive initializeCapture for this noninteractive path.

Verified on Arch DDE Treeland 0.8.15: wall ~0.5–0.6s (was ~6s),
save-to-notify ~0.5s (was ~6s), rapid double Print produces two files.
@svan71
svan71 force-pushed the fix/treeland-print-fullscreen-latency branch from 9157e16 to 9428daf Compare August 3, 2026 19:08
@svan71

svan71 commented Aug 3, 2026

Copy link
Copy Markdown
Author

Friendly ping for maintainer attention.

Rebased onto current master (post-6.6.38). CLA / commitlint / SPDX are green.

The red cppcheck ✗ is the known fork-PR CI issue (pull_request_target checkout refuse) — details in linuxdeepin/developer-center#13729 — not a code failure in this PR.

Would appreciate an /ok-to-test (and review when convenient). Happy to adjust anything.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants