user: hide title console window when DWM cloaking is unavailable (#175) #788
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/794"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by gsucristo on 2026-11-24T05:33:12Z.
Keep the title's 1920x1080 console window hidden when DWM window cloaking is unavailable (as under Wine), where
DwmSetWindowAttribute(DWMWA_CLOAK)fails or leavesDWMWA_CLOAKED == 0and causes the title's blank window to cover XCL's presenter window. Part of #175.What is in it
crates/xcl/src/hle/user.rs: queryDwmGetWindowAttribute(DWMWA_CLOAKED)afterDwmSetWindowAttribute(DWMWA_CLOAK); if cloaking did not take effect, callShowWindow(hwnd, SW_HIDE)and stripSWP_SHOWWINDOWinconsole_wndproconWM_WINDOWPOSCHANGINGso subsequent title show calls keep it hidden while keeping its 1920x1080 client rect.crates/xcl/src/hle/user.rs(tests): addconsole_window_stays_hidden_when_uncloaked.Tested
rustc 1.98.1(x86_64-pc-windows-msvccross-compile), debug.cargo test --workspace --no-fail-fast --target x86_64-pc-windows-msvc -- --test-threads=4 --skip a_freed_block_is_decommitted_before_its_address_is_reused: 700 passed, 4 failed (pre-existing Wine-only failures:hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetime,test_title_runs_and_game_folder_is_untouched,disk_free_space_ex_reports_pls_quota,set_predication_buffer_state_and_kickoff), 41 ignored, 1 filtered (a_freed_block_is_decommitted_before_its_address_is_reused).SKIPPEDGPU tests:gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask(no wave64),gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware(no wave64).hle::user::tests::console_window_stays_hidden_when_uncloaked(verifiedIsWindowVisible == 0under Wine afterShowWindow(SW_SHOW)andSetWindowPos(SWP_SHOWWINDOW)).Regression run
scripts/smoke.ps1runs on a retail title (Linux/Proton environment only).Not tested
cloaked != 0), AMD RDNA,scripts/smoke.ps1retail regression run.AI use
Imported from ivall/xcl. Originally posted by MesshM on 2026-11-24T05:51:23Z.
Test run of
bee31d566288a70b7c749146527577af73081c0don AMD RDNA4. I merged it onto currentmaine50836blocally (clean merge).Tested
stable-x86_64-pc-windows-msvc, debugcargo build --workspace+cargo test --workspace -- --test-threads=4on the merge: 705 passed, 0 failed, 41 ignored, exit code 0;xcllib tests 664 passed, 0 failed, 21 ignoredSKIPPED; theusertests pass.Review: Hiding the console window only when
DWMWA_CLOAKEDreads back 0 afterDWMWA_CLOAKleaves native Windows (where cloaking works) on the existing path. Not checked under Wine.Not tested: no retail title or regression run (I have no unpacked game), no
XCL_SAMPLE_*tests, release build; the PR's head on its old base was not run, only its merge ontomain.Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
Imported from ivall/xcl. Originally posted by Anon64 on 2026-11-24T07:17:49Z.
Regression runs for this PR's head
bee31d5and for its basemaind208e14, on a retail title (same title, 60 s each), made withscripts/smoke.ps1(release, clean tree at each commit) and pasted unedited, for Regression run.main:
this PR:
Tested
Not tested
Report written with Claude Code (Claude Opus 5.5) from runs on this machine.
Imported from ivall/xcl. Originally posted by NicolaiVdS on 2026-11-24T11:05:46Z.
Linux (Wine) report on NVIDIA.
Tested
xcl.execross-built in release forx86_64-pc-windows-gnu(MinGW), rustc 1.99.0.main09940bb+ #867 atdfe1aaa+ a small local change on top of #867 (XCL's own fences go through itsunwrap_fence) + #684'se56dbc3and #794'sbee31d5cherry-picked. Not this PR's head on its own.cargo test --release --target x86_64-pc-windows-gnu -p xcl --lib -- hle::xg::tests hle::user::tests, run under that Wine: 10 passed, 0 failed, 0 ignored.console_window_stays_hidden_when_uncloakedis one of them.… is the console's screen (1920x1080, no frame, cloaked)and a second, white 1920x1080 window stayed open next to XCL's. With it, every run (three) logs… (1920x1080, no frame, hidden), and the frames are presented in XCL's window as before.Not tested: Windows; the whole workspace suite (only
hle::xg/hle::user, under Wine);scripts/smoke.ps1; this PR without #684 and #867.AI use: Claude Code (Claude Opus 5.5) read the logs and the title's call site, built the branches, ran the tests and the scripted runs, and wrote this report. The runs are on my machine, on the hardware above.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T10:58:34Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
Imported from ivall/xcl. Originally posted by vakaobr on 2026-11-25T18:09:19Z.
Tested
bee31d5on a Mac, together with #1462: the test title's window check passes there with it.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 cleanly with #1462 onto the Mac branch from #258 (vakaobr/xclmac/integration, now5f9a58f, which also has #750 and #1698 so the title runs to the end), not ontomain.DwmSetWindowAttribute(DWMWA_CLOAK)returnsS_OKandDwmGetWindowAttribute(DWMWA_CLOAKED)returnsE_NOTIMPL(0x80004001; GE-Proton'sS_OKwith 0 in #1481 is another variant, which thehr_get < 0 || cloaked == 0test covers too). A small program making the same window (WS_POPUP | WS_VISIBLE,WS_EX_TOOLWINDOW, 1920x1080, cloaked) gets a window macOS lists as on screen at 1920x1080 (CGWindowListCopyWindowInfo), behind or over the presenter window depending on order.xcl run3 times: all 50 of its checks pass and it exits with 0. The log says(1920x1080, no frame, hidden). Without this and #1462 theuser32 …check fails (W: not cloaked).hle::user::tests, each in its own process: 4 of 4 pass,console_window_stays_hidden_when_uncloakedamong them.Not measured: whether macOS lists the hidden window. The test title's windows live for milliseconds, too short for me to catch in the window list, so that rests on the unit test (
IsWindowVisible0 after the title shows it again).A question rather than a finding: a hidden window is not visible to the title and cannot be the foreground window, where a cloaked one can be. A title that waits for its window to be visible or active could behave differently than on Windows. On this Mac a layered window with alpha 0 and
WS_EX_TRANSPARENTstays visible to Win32 while macOS draws it at alpha 0 (CGWindowList: on screen, alpha 0), in case that ever matters. I have no title that shows a difference.Not tested: Windows,
main, a retail title.AI use: Claude Code with Claude Opus 5.5 ran the tests and probes and wrote this report.
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T07:44:09Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Royalflamejlh on 2026-11-30T02:51:22Z.
@gsucristo the
PR descriptioncheck is what keeps this out of the merge queue (#3041): it wants twoxcl-smokeblocks under Regression run, one made on this head (bee31d56) and one on a commit ofmain, same title and time (scripts/smoke.ps1 -Game <folder>). Could you add them? It merges cleanly intomain(1c5acde4) and its build check is green. The Linux branch in #3067 carries it: under Wine the title's own window is not cloaked and covered XCL's. It is also markedstale, so it will be closed soon without activity.AI use: Claude Code (Claude Fable 5.2) read the check's log and wrote this.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:08:43Z.
Triage (#1607) – head
bee31d5No other open or merged PR hides the console window when DWM cloaking does not take effect. #1462 is the test-only companion: it updates the e2e window check to accept a hidden window and relies on this PR under Wine.
Main's
console_windowstill only callsDwmSetWindowAttribute(DWMWA_CLOAK).No problems found in the diff. On Windows the new unit test only checks the cloaked branch, so the hide path is exercised only under Wine.
Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:58:16Z.
Review (head
bee31d56, diff read, not a merge-check: thePR descriptioncheck fails (no xcl-smoke blocks), so not built or run here yet):elsebranchassert_ne!(cloaked, 0)(user.rs~371) is always true, so it neither checks hiding nor confirms cloaking worked; it only fails without the fix under Wine. Asserting something real in the cloaked branch, or splitting the decision into a testable function, would fix that.DwmGetWindowAttribute(DWMWA_CLOAKED)right afterDWMWA_CLOAK, not fromunder_wine(), so the Windows path stays unchanged only if DWM reports the window cloaked immediately; a Windows run should confirmxcl.logsays "cloaked", not "hidden".SetWindowLongPtrWfails (old == 0, ~175) the window is hidden once but nothing keeps it hidden.Fine: the merge with main is clean (
user.rsunchanged on main since the base), theWINDOWPOSlayout is right, the original window procedure runs beforeSWP_SHOWWINDOWis removed, the 1920x1080 client area is kept, and #3492 depends on this under Wine. Recommendation: worth a merge-check once the smoke blocks and model name are in the description.AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T17:22:38Z.
Test report (not a merge-check:
PR descriptionred)base:
b2b1f109d2head:
bee31d5662merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2903 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none
review: not repeated here; my review of this same head is at https://github.com/xcl-dev/xcl/pull/794#issuecomment-7303493536, and its findings stand. This run adds what reading couldn't: whether the change merges, builds and passes the whole suite on current main.
performance: no smoke run.
assessment: merges, builds and passes the whole suite on current main (0 failed) on Windows, where its Wine-specific path doesn't run; the findings in my review stand
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5
AI-written and posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-03T16:52:13Z.
merge-check
base:
16c2fd082ahead:
bee31d5662merge: clean
build: ok
tests: 3013 passed, 0 failed, 56 ignored; 28 skipped, the same as on main
review: 3 medium, 1 nit (below)
performance: 60 s smoke run: 1683 → 1668 frames (99 % of main), peak commit 18505 → 17814 MB, no device removal, no crash
title run: retail title on the RTX 5070 Ti (driver 621.14), into the world by scripted presses: 234 s there, 0 device removals, 0 crashes, 3.1 presents/s; run with
XCL_SKIP_CS=95cc13288a27a96e(the NVIDIA hang at the end of loading, #3541) and NVIDIA's 2048 MB shader heap (#2590)verdict: not yet:
PR descriptionis red; otherwise no blocking finding, the suite passes and the smoke run is cleanhardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5
In short: Hides the title's 1920x1080 console window when DWM cloaking does not take effect (Wine, CrossOver), and strips SWP_SHOWWINDOW so it stays hidden. The head is unchanged since my earlier review and test report, it merges cleanly, and main still only cloaks. Nothing blocks it in the code; the open points are a test that cannot fail on Windows and an unconfirmed Windows log line. The PR carries the stale label.
Medium
cloaked != 0, which is always true there. On Windows (CI and every merge-check) it checks neither the hiding nor that cloaking worked; it fails without the fix only under Wine. Move the decisionhr_set < 0 || hr_get < 0 || cloaked == 0into a function with a unit test, or force the hide path in the test.hide(~173) comes from reading DWMWA_CLOAKED right after setting DWMWA_CLOAK, not from under_wine(), so native Windows keeps the old path only if DWM reports the window cloaked at once. A native Windows run's xcl.log should say "cloaked", not "hidden".Nit
Checked and fine
How this was tested
16c2fd08, thencargo build --workspaceandcargo test --workspace --no-fail-fast -- --test-threads=4.scripts/smoke.ps1: 60 s of a retail title on main16c2fd08and on this merge; presents per 2 s at the end: 60 60 60.XCL_RUN_SECONDS=300and scripted A presses counted from the first frame (XCL_PRESS_BASE=frame, #3712) into the world from an existing save; time in the world is counted from the first in-world draw call to the end of the run.Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.