Skip to content

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

Merged
Groveer merged 1 commit into
linuxdeepin:masterfrom
zorowk:fix_screencopy
Sep 15, 2026
Merged

Groveer merged 1 commit 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

Make the wlr screencopy protocol test deterministic by controlling its headless output fixture and deriving capture dimensions from protocol events.

Bug Fixes:

  • Stabilize the wlr screencopy protocol fixture by using a deterministic single 1920×1080 headless output and sizing buffers and capture regions from layer-surface configuration.

Enhancements:

  • Improve screencopy test diagnostics for output rendering and frame failures.
  • Preserve an explicitly configured WLR_XWAYLAND environment value and ensure the test depends on the bundled Xwayland executable.

Documentation:

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

Tests:

  • Refine the screencopy protocol test setup and client coverage for full-output and regional captures.

Chores:

  • Format and reorganize the screencopy test client code and shared test 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

This PR stabilizes the wlroots screencopy protocol test by replacing the implicit 1280×720 headless output with a deterministic single 1920×1080 fixture, deriving client buffers and capture regions from layer configuration, and adding explicit XWayland test setup plus detailed rendering diagnostics.

Sequence diagram for configuration-driven screencopy capture

sequenceDiagram
    participant Fixture as Test fixture
    participant Compositor
    participant Client as Screencopy client
    participant Output as 1920x1080 output

    Fixture->>Compositor: Create one 1920x1080 headless output
    Compositor-->>Output: wl_output geometry and mode
    Client->>Compositor: Create layer surface
    Compositor-->>Client: configure(width, height)
    Client->>Client: Allocate buffer from configure dimensions
    Client->>Compositor: Commit layer surface buffer
    Client->>Compositor: zwlr_screencopy_manager_v1_capture_output
    Compositor-->>Client: Frame dimensions match configured output
    Client->>Compositor: zwlr_screencopy_frame_v1_copy
    Compositor-->>Client: Captured frame
Loading

File-Level Changes

Change Details Files
Make the screencopy test use an explicit, deterministic headless output fixture.
  • Disable wlroots’ implicit headless output for this test.
  • Create one 1920×1080 output during protocol-test setup.
  • Build the test XWayland executable before protocol tests and configure WLR_XWAYLAND explicitly, while preserving externally supplied settings.
tests/protocols/wlr-screencopy-unstable-v1/CMakeLists.txt
tests/protocols/wlr-screencopy-unstable-v1/setup.cpp
tests/protocols/framework/ProtocolTest.cmake
src/core/treeland.cpp
Drive layer rendering and screencopy validation from protocol-reported dimensions.
  • Store layer-surface configure width and height and use them for the source SHM buffer and damage.
  • Compute the 64×64 capture region from the configured layer dimensions.
  • Continue validating full-output and damaged-region captures against the rendered red frame.
tests/protocols/wlr-screencopy-unstable-v1/wlr-screencopy-unstable-v1.c
tests/protocols/wlr-screencopy-unstable-v1/screencopy-test.h
Improve screencopy test diagnostics and maintainability.
  • Capture render-state transitions and output commit status around server-side rendering.
  • Report frame event metadata, pixel mismatches, and render state on failures.
  • Reformat and reorganize the C client and document the explicit fixture and configure-derived sizing.
tests/protocols/wlr-screencopy-unstable-v1/wlr-screencopy-unstable-v1.c
tests/protocols/wlr-screencopy-unstable-v1/setup.cpp
tests/protocols/wlr-screencopy-unstable-v1/screencopy-test.h
tests/protocols/wlr-screencopy-unstable-v1/README.md

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
zorowk force-pushed the fix_screencopy branch 2 times, most recently from b2b87a8 to 7da90ff Compare September 7, 2026 07:18
@deepin-bot

deepin-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown

TAG Bot

New tag: 0.10.0
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #1392

Protocol tests need a build-tree Xwayland wrapper, deterministic screencopy dimensions and capture
failure diagnostics.

- Use the build-tree treeland-xwayland wrapper and preserve non-empty WLR_XWAYLAND overrides.
- Create a 1920x1080 headless fixture and derive client buffer and capture region dimensions from
  configure events.
- Log render state on capture failure while continuing to render every output and accumulating the
  sampled output commit result.

Keep protocol fixtures independent of an installed wrapper and distinguish missing output commits
from screencopy failures.

Combine exactly 6cbba9f and 61ef52e8a, preserving their final tree.
@zorowk
zorowk marked this pull request as ready for review September 14, 2026 06:46

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

@zorowk
zorowk requested review from zccrs and removed request for zccrs September 14, 2026 08:36
@Groveer
Groveer merged commit e12e151 into linuxdeepin:master Sep 15, 2026
7 checks passed
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.

3 participants