Skip to content

test(wayland): tools/wayland-matrix.sh and a nightly job drive TaskSmack on headless sway and labwc with a real pointer (#2724) - #3008

Merged
mgradwohl merged 3 commits into
mainfrom
test/wayland-matrix-2724
Oct 26, 2026
Merged

mgradwohl merged 3 commits into
mainfrom
test/wayland-matrix-2724

Conversation

@mgradwohl

@mgradwohl mgradwohl commented Oct 26, 2026 •

Copy link
Copy Markdown
Owner

Description

Fixes #2724, with #2978 (the on-display tests on native Wayland). tools/wayland-matrix.sh runs TaskSmack on a headless sway and a headless labwc and drives it with a real pointer, checking each result against the compositor's own idea of the window.

sway

  • The on-display suites, and the UI scenarios, on native Wayland.
  • A title-bar drag, which the compositor runs (DRAGGABLE): the window must move by exactly the pointer's travel, (150, 100).
  • A right-edge resize (RESIZE_RIGHT): about 120 px wider, with the left edge kept.
  • A second output at scale 1.5: the window moves onto it, then the output is unplugged under it. TaskSmack must survive, back on HEADLESS-1.
  • Persistence: the size at a close the compositor asks for (kill) is saved and restored on the next start.

labwc (sway never maximizes)

  • TitleBarButtonsDoWhatTheySay now checks Maximize and Restore on native Wayland when TASKSMACK_COMPOSITOR_MAXIMIZES=1. TheHitTestCallbackAnswersForTheRealWindow's maximized round runs too, instead of skipping.

Why a virtual-pointer tool: a headless seat has no input device, so it offers clients no pointer (seat capabilities: 0). Then neither swaymsg seat … cursor nor wlrctl pointer reaches TaskSmack, and wlrctl's device lives for only one command. tools/wayland/virtual-pointer.c (~120 lines of C) holds one zwlr_virtual_pointer_v1 and takes abs / move / press / release / quit on stdin, answering ok after each. The script builds it with wayland-scanner and cc. Its protocol XML is vendored from wlr-protocols (MIT, pinned commit, REUSE entry).

labwc on WSLg: labwc always starts Xwayland, which needs a sticky /tmp/.X11-unix. Where it isn't (WSLg), the script gives labwc its own in an unprivileged mount namespace (unshare -rm). CI runners don't need that.

docs/dev/wayland-test-matrix.md describes the script.

The nightly job: Heavy Checks gains wayland-matrix. It runs nightly, and on a dispatch with scope all. Ubuntu 24.04 installs sway, labwc and libwayland-dev, builds the debug preset, runs the script, and uploads its logs when a check fails. The maintainer approved merging this workflow change on green. Verified: dispatched run 40265404539's wayland-matrix job passed. That run's win-coverage failure was this PR's compositorMaximizes() calling std::getenv on Windows, where the CRT deprecates it; that's fixed in ce13f2c.

PR Size

⚠️ Medium (~470 lines: the script ~300, the C tool ~120, docs, a 4-line test change, and the vendored 152-line XML).

Type of Change

  • Build/CI improvement (tests and tooling)

Checklist

  • I have read the CONTRIBUTING guidelines
  • My code follows the project's coding standards
  • I have run clang-format on my changes
  • I have run pre-commit run --all-files or installed pre-commit hooks (REUSE and shellcheck included)
  • All new and existing tests pass
  • I have updated documentation as needed

Testing

tools/wayland-matrix.sh on WSL Ubuntu 26.04 with sway 1.11 and labwc 0.9.3, all checks passing:

== sway (headless) ==
  PASS  on-display tests
  PASS  UI scenarios
  PASS  title-bar drag moved the window by (150, 100)
  PASS  right-edge resize widened it by 120 px
  PASS  moved onto a second output at scale 1.5
  PASS  survived its output being unplugged, back on HEADLESS-1
  PASS  reopened at the 1400x720 it was closed at
== labwc (headless) ==
  PASS  Maximize and Restore, and the maximized window's hit test

shellcheck is clean. Xvfb runs are unaffected: the new environment switch is unset there.

Additional Notes

Found along the way: synthetic runs called themselves Administrator (#3004, fixed in #3005). Tooling and tests only, so no shipped code.

🤖 Generated with Claude Code

…way and labwc with a real pointer (#2724)

The second slice of the headless Wayland matrix. On sway: the on-display
suites; a title-bar drag and a right-edge resize, checked against swaymsg -t
get_tree; a second output at scale 1.5 that the window moves onto and that is
then unplugged under it; the size saved on a close the compositor asks for and
restored on the next start. On labwc: Maximize and Restore, which the
on-display test now checks on native Wayland when TASKSMACK_COMPOSITOR_MAXIMIZES=1.

A headless seat has no pointer device, so no client gets a pointer and
neither swaymsg's seat cursor nor wlrctl (whose device lives for one command)
reaches one: tools/wayland/virtual-pointer.c holds one zwlr_virtual_pointer_v1
and takes commands on stdin; its protocol XML is vendored from wlr-protocols
(MIT). labwc always starts Xwayland, so where /tmp/.X11-unix isn't sticky
(WSLg) it gets its own in an unprivileged mount namespace.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mgradwohl mgradwohl added this to the v0.10.0 milestone Oct 26, 2026
@mgradwohl mgradwohl added linux testing tooling Developer tooling, CI, editor config, and automation agent:WSL Owned by the Linux/WSL Claude session (bug-fix conveyor) labels Oct 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Oct 26, 2026
…rix.sh on headless sway and labwc (#2724)

The third slice of the headless Wayland matrix: nightly, and on a dispatch
with scope all, Ubuntu 24.04 installs sway, labwc and libwayland-dev, builds
the debug preset and runs the matrix, uploading its logs when a check fails.
The maintainer approved merging this workflow change on green.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the ci Refers to issues in the ci workflow label Oct 26, 2026
@mgradwohl
mgradwohl marked this pull request as ready for review October 26, 2026 04:13
@mgradwohl
mgradwohl enabled auto-merge (squash) October 26, 2026 04:13
…as onNativeWayland() does (#2724)

Windows' CRT deprecates getenv, which warnings-as-errors turned into a build
failure in win-coverage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mgradwohl mgradwohl changed the title test(wayland): tools/wayland-matrix.sh drives TaskSmack on headless sway and labwc with a real pointer (#2724) test(wayland): tools/wayland-matrix.sh and a nightly job drive TaskSmack on headless sway and labwc with a real pointer (#2724) Oct 26, 2026
@mgradwohl
mgradwohl merged commit 17df448 into main Oct 26, 2026
23 checks passed
@mgradwohl
mgradwohl deleted the test/wayland-matrix-2724 branch October 26, 2026 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent:WSL Owned by the Linux/WSL Claude session (bug-fix conveyor) ci Refers to issues in the ci workflow documentation Improvements or additions to documentation linux testing tooling Developer tooling, CI, editor config, and automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CI] Nightly headless Wayland matrix: sway/labwc with a virtual pointer, multi-output, scale and hot-plug

1 participant