kbm: leave the cursor free after a click on the title bar #967
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/973"
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:11Z.
A click on the XCL window's title bar snapped the cursor to the centre of the window and hid it. Two messages took the cursor there:
WM_ACTIVATEwithWA_CLICKACTIVE, which a click on the title bar of an inactive window sends, andWM_EXITSIZEMOVE, which ends the move loop that any click on the title bar starts, even without a drag. Both clipped the cursor to the one-pixel point at the client area's centre.Now only keyboard activation (Alt+Tab, the window opening) and a click in the client area (
WM_LBUTTONDOWN) take the cursor.WM_SIZE/WM_MOVEmove the held point only while the cursor is held, so maximising from the title bar leaves it free too. Dragging the window (#176) is unchanged.What is in it
crates/xcl/src/hle/kbm.rs: the decision is a pure function,cursor_hold, used byon_message; the testtitle_bar_clicks_leave_the_cursor_free.Tested
cargo test --workspace -- --test-threads=4on03d39a1: 720 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: 8 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:32Z.
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:38Z.
Empirical test report (
03d39a1b)Hardware / environment
1.100.0 (0ef1bc386 2026-11-09)and DXC1.9.2609.5 (01b62ad47). Cargo used the test profile with debug info and incremental compilation disabled.03d39a1b2b9799ad51530d05561810ff29c4dd58. Both Cargo commands ran directly, outsideInvoke-ArcTest.ps1, with zero Arc GPU mutex hold.Commands and results
cargo test --workspace --no-runexited 0 and built the workspace test executables.XCL_ADAPTER=NONE_CPU_ONLYandRUST_TEST_NOCAPTURE=1,cargo test -p xcl --lib hle::kbm::tests::title_bar_clicks_leave_the_cursor_free -- --nocaptureexited 0. The focused log recorded 1 passed, 0 failed, 0 ignored, and 0 skipped.Observed behavior
The new CPU-only unit test calls
cursor_holddirectly. Its assertions passed for click activation, entry to and exit from the move loop, and movement and resizing while the cursor is free. It also checked capture on client-area left click and keyboard activation, keeping the cursor held on resize, and releasing it on focus loss.Not tested
The full GPU workspace suite and game smoke runs were omitted. Live Win32 message delivery and cursor clipping were outside this unit test's coverage.
AI use
Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against
pr973-focused.logand published.upstream-sync referenced this pull request2026-11-25 07:04:28 +00:00
Imported from ivall/xcl. Originally posted by S1m0ne1997 on 2026-11-25T14:23:28Z.
Test report for
03d39a1b2b9799ad51530d05561810ff29c4dd58(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: 720 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:28Z.
amd-win test report for head
03d39a1b2b9799ad51530d05561810ff29c4dd58Setup
main06c9f5505f63f10c5ec49ef932d75b2c28177324(merge commitfc50f56e10ef169d03b35ac1756992caa3d67324; 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: 1265 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::title_bar_clicks_leave_the_cursor_freepasses.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
cursor_holdunit test and a title run were done.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:28Z.
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:26:13Z.
merge-check claim
head:
03d39a1b2bImported from ivall/xcl. Originally posted by brainhay5 on 2026-11-30T06:39:51Z.
merge-check
base:
d52ff48caahead:
03d39a1b2bmerge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2876 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-30T09:39:48Z.
merge-check claim
head:
03d39a1b2bImported from ivall/xcl. Originally posted by BBareth on 2026-11-30T09:45:58Z.
merge-check
base:
9dfbe3ea66head:
03d39a1b2bmerge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2886 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. The new test
hle::kbm::tests::title_bar_clicks_leave_the_cursor_freepassed.review: no blocking finding; one file, every hunk read. The window procedure's cursor decisions move into a pure function
cursor_hold(msg, wparam, captured), tested for the title-bar click, the move loop, maximising, a client-area click, keyboard activation and focus loss. Behaviour changes to know about, both as the description says: activation by click (WA_CLICKACTIVE) no longer takes the cursor by itself, and the end of a move loop (WM_EXITSIZEMOVE) no longer takes it back, so after dragging the window the cursor stays free until a click in the client area or the next keyboard activation. WM_SIZE / WM_MOVE re-place the held point only while the cursor is held. Not tested by me: the behaviour with a real window and mouse (the unit test covers the decision table only). #974 (open, same author) builds on the same code and will need this one first or a rebase.performance: none; a few integer compares per window message.
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 Elytes on 2026-11-30T11:11:05Z.
merge-check
base:
9dfbe3ea66head:
03d39a1b2bmerge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2886 passed, 1 failed, 51 ignored; SKIPPED: 28 (22 no wave64, 2 no heap windows, 3 no D3D12 debug layer, 1 driver cache needs Developer Mode); failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16, also failing on the base alone (base lib 2737 passed / 1 failed, merge 2738 / 1; the +1 is this PR's test, passing, with the other 8 kbm tests).
review: no blocking finding after reading the whole diff and the comments. Compared with main: WA_CLICKACTIVE and WM_EXITSIZEMOVE no longer take the cursor (after a drag it stays free until a click in the client area, as described), WM_SIZE / WM_MOVE re-hold it only while it is held, and keyboard activation, a client-area click and focus loss behave as before. Hand test by me on the retail title with the merge's release build: after clicking the desktop, a click on the window's title bar leaves the cursor visible and free; a click inside the window takes it; Alt+Tab away frees it and Alt+Tab back takes it.
performance: none (window messages only).
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 5090 (driver 32.0.16.1742, wave32), Intel Core i9-14900KS, 192 GB, Windows 11 build 26300.10075, rustc 1.100.1, debug suite, release for the hand test / Claude Code (Claude Opus 5.5) ran the merge, build and suite, compared the message handling with main and launched the title; the hand test was mine.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:34:06Z.
Triage (#1607) – head
03d39a1#974 is stacked on this PR: it contains this commit (
03d39a1) plus one of its own. That is not a duplicate. No other open or merged PR changes the cursor handling inkbm.rs. #176 (merged) added the free-while-dragging behaviour that this refines.cursor_holdno longer takes the cursor onWA_CLICKACTIVE, onWM_EXITSIZEMOVE, or onWM_SIZE/WM_MOVEwhile the cursor is not held. Mouse state is still reset on focus loss and on entering a move loop. A click in the client area still takes the cursor throughWM_LBUTTONDOWN. It merges cleanly onto current main. 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.