kbm: the window takes the cursor when it has the focus at attach #968
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/974"
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 b4rightnow on 2026-11-24T09:46:37Z.
Stacked on #973; only the top commit (
5b2d568) belongs here.Sometimes the mouse did nothing in a title until the XCL window was clicked away from and back. The window is created with
WS_VISIBLE, soCreateWindowExWshows and activates it and sends itsWM_ACTIVATEbefore it returns.kbm::attach, which records the window, runs only after that (present.rs,window_thread), soon_messagetook that message for another window's and passed over it. The cursor was never held, and mouse movement, which counts only while the cursor is held, went unread until the window was activated again. It happened only when Windows activated the new window; otherwise the first click into it was the activation and input worked. Keyboard keys were not affected (they need only the focus).attachnow takes the cursor itself when the window has the focus by then, throughcursor_holdas thatWM_ACTIVATEwould have.What is in it
crates/xcl/src/hle/kbm.rs:attachholds the cursor of a window that has the focus (attach_activation→cursor_hold); the testa_window_attached_with_the_focus_takes_the_cursor.Tested
cargo test --workspace -- --test-threads=4on5b2d568: 721 passed, 0 failed, 41 ignored.gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64).cargo test -p xcl --lib kbm: 9 passed, 0 failed.Regression run
main:
this PR:
Not tested
AI use
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T13:51:31Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:Thanks!
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T05:38:36Z.
Empirical test report (
5b2d5689)PR #974, tested at commit
5b2d568992cce45124d58d0396dcecea595072d1.Hardware / environment
rustc 1.100.0 (0ef1bc386 2026-11-09). DXC1.9.2609.5 (01b62ad47), as reported by the bundleddxcompiler.dll.XCL_ADAPTER=NONE_CPU_ONLYandRUST_TEST_NOCAPTURE=1. Both commands ran directly through Cargo, outsideInvoke-ArcTest.ps1, with zero Arc GPU mutex hold.Commands and results
cargo test --workspace --no-runexited 0 and built the workspace test executables.cargo test -p xcl --lib 'hle::kbm::tests::' -- --nocaptureexited 0. The test summary recorded 8 passed, 0 failed, 0 ignored, and 693 filtered out. The log contained 0 uppercaseSKIPPEDlines.Observed behavior
a_window_attached_with_the_focus_takes_the_cursorpassed. With foreground input, the cursor decision requests capture. With background input, it does not request capture.title_bar_clicks_leave_the_cursor_freepassed. The decision leaves the cursor free through title-bar activation, moving, and maximizing. Client-area clicks and ordinary activation request capture. A held cursor follows resizing and is released on focus loss.Not tested
The full GPU workspace suite, game smoke runs, and live Win32 window activation and cursor capture were omitted.
AI use
Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against
pr974-focused.logand published.Imported from ivall/xcl. Originally posted by S1m0ne1997 on 2026-11-25T14:28:45Z.
Test report for
5b2d568992cce45124d58d0396dcecea595072d1(this PR's head), for #1607.Tested
rustc 1.100.0 (0ef1bc386 2026-11-09)x86_64-pc-windows-msvc, debug.cargo build --workspace, thencargo test --workspace -- --test-threads=4at the head: 721 passed, 0 failed, 41 ignored.gpu_geometry_wave32_prefix_count_over_a_mask(no wave64),gpu_wave32_program_in_wave64_hardware(no wave64).Regression run (retail title,
scripts/smoke.ps1 -Seconds 60, release;mainbuilt from the commit in its block, this PR from its head, no uncommitted changes)main:
this PR:
Not tested
AI use: Claude Code with Claude Opus 5.5 ran the build, the suite and the regression run and wrote this report at my request.
Imported from ivall/xcl. Originally posted by oni-swr on 2026-11-25T14:49:30Z.
amd-win test report for head
5b2d568992cce45124d58d0396dcecea595072d1Setup
main06c9f5505f63f10c5ec49ef932d75b2c28177324(merge commitbf7c558c0fde86eaefa6780ccb011b2436324b23; it merged without conflicts). That is not the PR head itself, so the smoke block below names the merge commit.Tests
cargo build --workspacethencargo test --workspace --no-fail-fast -- --test-threads=4: 1266 passed, 1 failed, 46 ignored, 7SKIPPEDlines (f16/f32 per-lane form, no heap windows)gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1(seed 722:res[30]GPU 0x1 vs CPU 0x7fffffff). It fails the same way onmain(1264 passed, 1 failed, 46 ignored), so it is not caused by this PR.hle::kbm::tests::a_window_attached_with_the_focus_takes_the_cursorpasses.Regression run (60 s, same title, networking off;
mainfirst, then the merge)Exit code 0x0 on both. The full
xcl-smokeblocks are not pasted because of the merge-commit caveat above.Not tested
AI use: this run and report were done by Claude Code (Claude Sonnet 5.5).
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T03:23:30Z.
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
Imported from ivall/xcl. Originally posted by brainhay5 on 2026-11-30T06:40:14Z.
merge-check claim
head:
5b2d568992Imported from ivall/xcl. Originally posted by brainhay5 on 2026-11-30T06:53:51Z.
merge-check
base:
d52ff48caahead:
5b2d568992merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2877 passed, 2 failed, 51 ignored; 29 SKIPPED lines
failing: test_title_runs_and_game_folder_is_untouched
review: automated overnight check — diff inspected for safety only (no build/CI/toolchain/script changes, no process/network/runtime-loading code); no duplicate search performed; no line-by-line code review.
performance: not assessed beyond the suite.
verdict: safe to merge
hardware / tool and model: RTX 5070 Ti 16 GB, driver 610.88 (32.0.16.1088); Ryzen 7 5800X3D, 64 GB; Windows 11 22631; OpenCode agent, DeepSeek V4.1 Flash 1017
correction: this check first reported the PR as "not yet" because of a test failure that is not the PR's. The base-comparison step failed to run (test names contain a double colon, not a legal Windows filename), so an empty read was mistaken for "passes on base".
gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16fails on based52ff48cby itself (verified separately with the same command: "assertion failed: 2D D16 resinfo clobbered v2/v3"). Verdict corrected. Apologies for the noise.Imported from ivall/xcl. Originally posted by BBareth on 2026-11-30T10:10:26Z.
merge-check claim
head:
5b2d568992Imported from ivall/xcl. Originally posted by BBareth on 2026-11-30T10:22:34Z.
merge-check
base:
9dfbe3ea66head:
5b2d568992merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2887 passed, 1 failed, 51 ignored; failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16, which fails on the base alone too (base: 2885 passed, 1 failed, 51 ignored, 28 SKIPPED lines). 28 SKIPPED lines, as on the base. Both kbm tests passed (
a_window_attached_with_the_focus_takes_the_cursor, andtitle_bar_clicks_leave_the_cursor_freefrom #973).review: no blocking finding; one file, both commits read. Stacked on #973: the merge result contains #973's commit
03d39a1btoo, so this check covers the two together and #973 has to go in first (or with it). The top commit makesattachtake the cursor when the window already has the focus, because the window is activated inside CreateWindowExW before XCL attaches to it and that WM_ACTIVATE was passed over; it goes through the samecursor_holddecision as a real activation. Not tested by me: a real window and mouse; the unit test covers the decision only.performance: none; one foreground-window query at attach.
verdict: safe to merge
hardware / tool and model: RTX 5070 Ti 16 GB, driver 621.24 (32.0.16.2124); i7-12700K; Windows 11 26200. Claude Code, Claude Fable 5.2 read the diff, ran the build and the suite and wrote this check.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:34:22Z.
Triage (#1607) – head
5b2d568Stacked on #973: the first commit (
03d39a1) is #973's, and only5b2d568belongs here, so the shared lines are not a duplicate. No other open or merged PR handles theWM_ACTIVATEthatCreateWindowExWsends beforekbm::attach.attachnow runs that activation throughcursor_holdwhenGetForegroundWindow() == hwnd. That fits the window being created withWS_VISIBLEbefore it is attached. It merges cleanly onto current main. No problems found in the diff.Recommendation: keep open (merge after #973).
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
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.