Skip to content

test(protocols): stabilize wlr screencopy fixture - #1369

Draft
zorowk wants to merge 2 commits into
linuxdeepin:masterfrom
zorowk:fix_screencopy
Draft

test(protocols): stabilize wlr screencopy fixture#1369
zorowk wants to merge 2 commits into
linuxdeepin:masterfrom
zorowk:fix_screencopy

Conversation

@zorowk

@zorowk zorowk commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

The screencopy protocol test relied on wlroots implicit 1280x720 output while its fixture documentation and client expected 1920x1080.

  • Disable the implicit headless output and create the documented 1920x1080 fixture output.
  • Derive layer buffer and capture-region dimensions from the configure event.
  • Format the C client and update the Chinese test documentation.

A deterministic single output keeps the captured frame dimensions aligned with the rendered source buffer.

Summary by Sourcery

Stabilize the wlroots screencopy protocol test with a deterministic 1920×1080 output and configuration-driven capture validation.

Bug Fixes:

  • Stabilize the wlroots screencopy protocol fixture by explicitly creating a single 1920×1080 headless output and aligning rendered and captured dimensions with the configured surface.

Enhancements:

  • Improve screencopy fixture diagnostics by recording output render state and capture event details on failures.
  • Preserve externally supplied WLR_XWAYLAND configuration and ensure protocol tests build against the Treeland Xwayland helper.

Documentation:

  • Update the Chinese screencopy test documentation to describe the deterministic output fixture and configure-derived client dimensions.

Tests:

  • Make screencopy capture regions and layer buffers derive their dimensions from layer configure events, while validating full-output and damaged-region captures.

Chores:

  • Format and reorganize the screencopy protocol test client and add shared render-state definitions.

@zorowk
zorowk marked this pull request as draft September 2, 2026 08:25
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: zorowk

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

@sourcery-ai

sourcery-ai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Reviewer's Guide

Stabilizes the wlroots screencopy fixture by replacing the implicit 1280×720 output with a single explicit 1920×1080 output, deriving rendered and capture dimensions from configure/capture events, and formatting the client and documentation for clearer diagnostics and maintenance.

File-Level Changes

Change Details Files
Make the screencopy test use a deterministic, documented output fixture.
  • Disable wlroots’ default headless output for this test.
  • Create one explicit 1920×1080 headless output during fixture setup.
  • Document the fixture and dimension-handling changes.
tests/protocols/wlr-screencopy-unstable-v1/CMakeLists.txt
tests/protocols/wlr-screencopy-unstable-v1/setup.cpp
tests/protocols/wlr-screencopy-unstable-v1/README.md
Align rendered and captured buffers with protocol-provided dimensions.
  • Store layer-surface configure width and height and use them for the red SHM buffer and surface damage.
  • Calculate the 64×64 capture region from the configured layer dimensions.
  • Pass region coordinates through the capture helper while retaining full-output and damage-copy coverage.
tests/protocols/wlr-screencopy-unstable-v1/wlr-screencopy-unstable-v1.c
Improve readability and diagnostics of the screencopy client.
  • Reformat callbacks, buffer creation, capture flow, and resource cleanup.
  • Expand frame and pixel failure diagnostics without changing the tested protocol scenarios.
tests/protocols/wlr-screencopy-unstable-v1/wlr-screencopy-unstable-v1.c

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@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.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

zorowk added 2 commits September 7, 2026 15:17
Protocol tests run an uninstalled Treeland build, while the screencopy fixture needs deterministic
headless output dimensions.

- Use the build-tree treeland-xwayland wrapper when running protocol tests.
- Preserve the installed Xwayland-wrapper default unless WLR_XWAYLAND is explicitly configured.
- Create the documented 1920x1080 screencopy fixture and derive client dimensions from configure
  events.

Keep protocol fixtures runnable and deterministic in CI without depending on an installed wrapper.
wlr-screencopy protocol test

- Capture output render state around the fixture render.
- Report the state only when a capture frame fails.

Make CI failures distinguish a missing output commit from a screencopy copy failure
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