Skip to content

e2e: the console screen may be hidden where DWM cannot cloak it - #1462

Open
crastinator wants to merge 1 commit into
xcl-dev:mainfrom
crastinator:testtitle-hidden-console-window
Open

crastinator wants to merge 1 commit into
xcl-dev:mainfrom
crastinator:testtitle-hidden-console-window

Conversation

@crastinator

@crastinator crastinator commented Nov 24, 2026 •

Copy link
Copy Markdown

The e2e test title's window check required DWMWA_CLOAKED != 0. Under Wine, DwmGetWindowAttribute(DWMWA_CLOAKED) returns S_OK with cloaked 0, since there is no DWM cloaking, so the check fails on every Linux and macOS run (W: not cloaked). #794 makes XCL hide the window in that case. This updates the check to match, and also tests the second half of #794: a title showing the window again must not bring it back. Part of #175; a test-only companion to #794.

It is based on main, not stacked on #794, so it stays test-only. Under Wine the check passes only once #794 is merged. On Windows the window is cloaked, so it passes as before.

What is in it

  • tests/testtitle/src/main.rs, the user32 window check:
    • a window must be cloaked, or (where DWM reports it uncloaked, as user: hide title console window when DWM cloaking is unavailable (#175) #794 decides) not visible;
    • after ShowWindow(SW_SHOW) and SetWindowPos(SWP_SHOWWINDOW | SWP_NOACTIVATE) it must still be cloaked or hidden;
    • both windows and the class are destroyed and unregistered on every path, and a failed cleanup is reported;
    • the messages include the HRESULT and the cloaked value.

Tested

Regression run

  • Not needed: test-only (tests/testtitle).

Not tested

  • Windows myself. @futurepro62 ran the whole suite at 813615c on Windows 11, on an RTX 5070 Ti and on a Ryzen 9800X3D's RDNA2 iGPU: 751 passed, 0 failed, 41 ignored on both, so the cloaked branch and the show step pass on a real DWM (comment).
  • macOS / CrossOver.
  • Anything that needs game files: no XCL_SAMPLE_* set.

AI use

  • Claude Code (Claude Opus 5.5) wrote the change, ran the tests and wrote this description. It went through 4 rounds of code review and the findings were fixed. I read and checked the diff.

The test title's window check required DWMWA_CLOAKED != 0. Under Wine,
DwmGetWindowAttribute(DWMWA_CLOAKED) succeeds and reports 0 (no DWM
cloaking), so the check failed with "W: not cloaked" on every Linux and macOS
run. xcl-dev#794 makes XCL hide the window in that case and keep it hidden when the
title shows it again (SWP_SHOWWINDOW stripped in WM_WINDOWPOSCHANGING).

The check now accepts that, with xcl-dev#794's own condition: a window must be
cloaked, or not visible. It also shows each window again (ShowWindow SW_SHOW,
SetWindowPos SWP_SHOWWINDOW) and requires it to stay concealed, which covers
the second half of xcl-dev#794 on every platform. The two windows and the class are
cleaned up on every path, and a failed cleanup is reported.
@futurepro62

futurepro62 commented Nov 24, 2026 •

Copy link
Copy Markdown

Full-suite run, since this PR has no test report yet. Tested exact head 813615c (on its base 930e8b4).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 751 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • No new #[test] functions in the diff.
  • Same head on the AMD Radeon iGPU of the 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 751 passed, 0 failed, 41 ignored, no skips.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.

@DavidM1911

Copy link
Copy Markdown
Contributor

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified main.)

Thanks!

@vakaobr

vakaobr commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Tested 813615c on a Mac, with #794: the window check passes there.

Tested (MacBook Pro M5 Pro, macOS 27.2.1, CrossOver 26.3.0, D3DMetal 3.0, Rust 1.100.0 x86_64-pc-windows-gnu, debug), cherry-picked with #794 onto the Mac branch from #258 (vakaobr/xcl mac/integration, now 5f9a58f), not onto main.

  • The test title, run with xcl run 3 times: all 50 checks pass and it exits with 0, the user32 … check included. Without the two it fails W: not cloaked.
  • Under CrossOver, DwmGetWindowAttribute(DWMWA_CLOAKED) returns E_NOTIMPL (0x80004001) rather than the S_OK with 0 in the description and commit message. The check already covers that ((hr >= 0 && cloaked != 0) || IsWindowVisible(h) == 0), so only the wording differs.

Not tested: Windows, main without #794.

AI use: Claude Code with Claude Opus 5.5 ran the tests and wrote this report.

Update 11-29: on CrossOver 26.3, DwmGetWindowAttribute(DWMWA_CLOAKED) returns E_NOTIMPL (0x80004001), not S_OK with cloaked 0 as the description says for Wine; this PR's check handles both (hr >= 0 && cloaked != 0 or not visible). Without #794, main + this PR still fails there, as expected: W: neither cloaked nor hidden (DwmGetWindowAttribute 0x80004001, cloaked 0).

vakaobr added a commit to vakaobr/xcl that referenced this pull request Nov 26, 2026
Royalflamejlh added a commit to Royalflamejlh/xcl that referenced this pull request Nov 27, 2026
The e2e title's cloak check accepts a hidden screen where DWM cannot cloak
(Wine), the green check for xcl-dev#794.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Royalflamejlh added a commit to Royalflamejlh/xcl that referenced this pull request Nov 27, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

@github-actions github-actions Bot added the stale No activity for 3 days; closed 4 days later unless something happens label Nov 29, 2026
@crastinator

Copy link
Copy Markdown
Author

Still waiting for a maintainer. It still fixes the test title's window check, which fails W: not cloaked on every Wine and CrossOver run (once #794 is in). It merges cleanly with main.

#1481 changes the same check. The differences:

If maintainers prefer #1481, I'm happy to close this one.

@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Triage (#1607) – head 813615c

Test-only companion to #794 (which hides the window in user.rs where DWM cannot cloak it); not stacked on it and not a duplicate. The other PRs on #175 (#494, #669, #793, #3492) do not touch this check, and main's window check still requires cloaked != 0 only. No problems found in the diff.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

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

Labels

off-goal Does not bear on the current goal (world loading); waits until it is reached stale No activity for 3 days; closed 4 days later unless something happens

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants