kbm: the window takes the cursor when it has the focus at attach #968

Open
b4rightnow wants to merge 1 commit from upstream-pr/974 into main
b4rightnow commented 2026-11-24 09:46:37 +00:00 (Migrated from github.com)

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, so CreateWindowExW shows and activates it and sends its WM_ACTIVATE before it returns. kbm::attach, which records the window, runs only after that (present.rs, window_thread), so on_message took 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).

attach now takes the cursor itself when the window has the focus by then, through cursor_hold as that WM_ACTIVATE would have.

What is in it

  • crates/xcl/src/hle/kbm.rs: attach holds the cursor of a window that has the focus (attach_activation → cursor_hold); the test a_window_attached_with_the_focus_takes_the_cursor.

Tested

  • NVIDIA GeForce RTX 3080 Ti (driver 621.01), AMD Ryzen 7 9800X3D, Windows 11 Pro 26200, rustc 1.100.0; tests in debug, regression runs in release.
  • cargo test --workspace -- --test-threads=4 on 5b2d568: 721 passed, 0 failed, 41 ignored.
  • SKIPPED: 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.
  • By hand on the same machine (tested by me, the PR's author), a retail title with this build: the mouse moves the camera right after start, without clicking another window and back.

Regression run

main:

xcl-smoke v1
commit: 6bac4b4419886acc940d479dcf8815d0b1804435
gpu: NVIDIA GeForce RTX 3080 Ti
title: 28c7ff61
seconds: 60
exit: 0x0
frames shown: 3202 (PresentX 3203)
presents per 2 s (last 3): 120 120 120
device removals: 0
crashes: 0
peak commit: 18098 MB

this PR:

xcl-smoke v1
commit: 5b2d568992cce45124d58d0396dcecea595072d1
gpu: NVIDIA GeForce RTX 3080 Ti
title: 28c7ff61
seconds: 60
exit: 0x0
frames shown: 3105 (PresentX 3105)
presents per 2 s (last 3): 55 84 120
device removals: 0
crashes: 0
peak commit: 22191 MB

Not tested

  • An automated test of a real window's activation order: the unit test covers the decision only.
  • AMD and Intel GPUs; Windows 10.

AI use

  • Claude Code, Claude Opus 5.5: found the cause, wrote the change and its test, ran the tests and the regression runs, wrote this description. The hand test was mine.
<!-- greyfinch-sync:ivall/xcl:issue:5469786676 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/974). Originally posted by [b4rightnow](https://github.com/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`, so `CreateWindowExW` shows and activates it and sends its `WM_ACTIVATE` before it returns. `kbm::attach`, which records the window, runs only after that (`present.rs`, `window_thread`), so `on_message` took 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). `attach` now takes the cursor itself when the window has the focus by then, through `cursor_hold` as that `WM_ACTIVATE` would have. **What is in it** - `crates/xcl/src/hle/kbm.rs`: `attach` holds the cursor of a window that has the focus (`attach_activation` → `cursor_hold`); the test `a_window_attached_with_the_focus_takes_the_cursor`. **Tested** - NVIDIA GeForce RTX 3080 Ti (driver 621.01), AMD Ryzen 7 9800X3D, Windows 11 Pro 26200, rustc 1.100.0; tests in debug, regression runs in release. - `cargo test --workspace -- --test-threads=4` on 5b2d568: 721 passed, 0 failed, 41 ignored. - SKIPPED: `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. - By hand on the same machine (tested by me, the PR's author), a retail title with this build: the mouse moves the camera right after start, without clicking another window and back. **Regression run** main: ``` xcl-smoke v1 commit: 6bac4b4419886acc940d479dcf8815d0b1804435 gpu: NVIDIA GeForce RTX 3080 Ti title: 28c7ff61 seconds: 60 exit: 0x0 frames shown: 3202 (PresentX 3203) presents per 2 s (last 3): 120 120 120 device removals: 0 crashes: 0 peak commit: 18098 MB ``` this PR: ``` xcl-smoke v1 commit: 5b2d568992cce45124d58d0396dcecea595072d1 gpu: NVIDIA GeForce RTX 3080 Ti title: 28c7ff61 seconds: 60 exit: 0x0 frames shown: 3105 (PresentX 3105) presents per 2 s (last 3): 55 84 120 device removals: 0 crashes: 0 peak commit: 22191 MB ``` **Not tested** - An automated test of a real window's activation order: the unit test covers the decision only. - AMD and Intel GPUs; Windows 10. **AI use** - Claude Code, Claude Opus 5.5: found the cause, wrote the change and its test, ran the tests and the regression runs, wrote this description. The hand test was mine.
DavidM1911 commented 2026-11-24 14:06:45 +00:00 (Migrated from github.com)

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:

  • lib kbm: 5 passed, 0 failed.

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7133441378 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/974#issuecomment-7133441378). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T13:51:31Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - lib kbm: 5 passed, 0 failed. Thanks!
JJAutoCompare commented 2026-11-25 06:05:55 +00:00 (Migrated from github.com)

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

  • Windows x64, build 26200. AMD CPU (Family 23, Model 113, Stepping 0), 12 logical processors visible.
  • rustc 1.100.0 (0ef1bc386 2026-11-09). DXC 1.9.2609.5 (01b62ad47), as reported by the bundled dxcompiler.dll.
  • Unoptimized test profile with debug info and incremental compilation disabled. The focused run used XCL_ADAPTER=NONE_CPU_ONLY and RUST_TEST_NOCAPTURE=1. Both commands ran directly through Cargo, outside Invoke-ArcTest.ps1, with zero Arc GPU mutex hold.

Commands and results

  • cargo test --workspace --no-run exited 0 and built the workspace test executables.
  • cargo test -p xcl --lib 'hle::kbm::tests::' -- --nocapture exited 0. The test summary recorded 8 passed, 0 failed, 0 ignored, and 693 filtered out. The log contained 0 uppercase SKIPPED lines.

Observed behavior

  • a_window_attached_with_the_focus_takes_the_cursor passed. With foreground input, the cursor decision requests capture. With background input, it does not request capture.
  • title_bar_clicks_leave_the_cursor_free passed. 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.
  • Both added tests exercise Rust decision helpers and require neither D3D12 nor a GPU.

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.log and published.

<!-- greyfinch-sync:ivall/xcl:comment:7153991778 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/974#issuecomment-7153991778). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-25T05:38:36Z. --- ### Empirical test report (5b2d5689) PR #974, tested at commit `5b2d568992cce45124d58d0396dcecea595072d1`. **Hardware / environment** - Windows x64, build 26200. AMD CPU (Family 23, Model 113, Stepping 0), 12 logical processors visible. - `rustc 1.100.0 (0ef1bc386 2026-11-09)`. DXC `1.9.2609.5 (01b62ad47)`, as reported by the bundled `dxcompiler.dll`. - Unoptimized test profile with debug info and incremental compilation disabled. The focused run used `XCL_ADAPTER=NONE_CPU_ONLY` and `RUST_TEST_NOCAPTURE=1`. Both commands ran directly through Cargo, outside `Invoke-ArcTest.ps1`, with zero Arc GPU mutex hold. **Commands and results** - `cargo test --workspace --no-run` exited 0 and built the workspace test executables. - `cargo test -p xcl --lib 'hle::kbm::tests::' -- --nocapture` exited 0. The test summary recorded 8 passed, 0 failed, 0 ignored, and 693 filtered out. The log contained 0 uppercase `SKIPPED` lines. **Observed behavior** - `a_window_attached_with_the_focus_takes_the_cursor` passed. With foreground input, the cursor decision requests capture. With background input, it does not request capture. - `title_bar_clicks_leave_the_cursor_free` passed. 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. - Both added tests exercise Rust decision helpers and require neither D3D12 nor a GPU. **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.log` and published.
S1m0ne1997 commented 2026-11-25 15:07:49 +00:00 (Migrated from github.com)

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

  • NVIDIA GeForce RTX 4090 24 GB (driver 621.40), AMD Ryzen 9 9950X3D, 47 GB RAM, Windows 11 Home 10.0.26300, rustc 1.100.0 (0ef1bc386 2026-11-09) x86_64-pc-windows-msvc, debug.
  • cargo build --workspace, then cargo test --workspace -- --test-threads=4 at the head: 721 passed, 0 failed, 41 ignored.
  • SKIPPED (2): 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; main built from the commit in its block, this PR from its head, no uncommitted changes)

main:

xcl-smoke v1
commit: 06c9f5505f63f10c5ec49ef932d75b2c28177324
gpu: NVIDIA GeForce RTX 4090
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1599 (PresentX 1599)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16384 MB

this PR:

xcl-smoke v1
commit: 5b2d568992cce45124d58d0396dcecea595072d1
gpu: NVIDIA GeForce RTX 4090
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1629 (PresentX 1629)
presents per 2 s (last 3): 34 59 60
device removals: 0
crashes: 0
peak commit: 17788 MB

Not tested

  • AMD, other NVIDIA cards and drivers, Linux. I did not review the diff; this report is the build, the suite and the regression run only.

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.

<!-- greyfinch-sync:ivall/xcl:comment:7165340933 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/974#issuecomment-7165340933). Originally posted by [S1m0ne1997](https://github.com/S1m0ne1997) on 2026-11-25T14:28:45Z. --- Test report for `5b2d568992cce45124d58d0396dcecea595072d1` (this PR's head), for #1607. **Tested** - NVIDIA GeForce RTX 4090 24 GB (driver 621.40), AMD Ryzen 9 9950X3D, 47 GB RAM, Windows 11 Home 10.0.26300, `rustc 1.100.0 (0ef1bc386 2026-11-09)` `x86_64-pc-windows-msvc`, debug. - `cargo build --workspace`, then `cargo test --workspace -- --test-threads=4` at the head: **721 passed, 0 failed, 41 ignored**. - SKIPPED (2): `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; `main` built from the commit in its block, this PR from its head, no uncommitted changes) main: ``` xcl-smoke v1 commit: 06c9f5505f63f10c5ec49ef932d75b2c28177324 gpu: NVIDIA GeForce RTX 4090 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1599 (PresentX 1599) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16384 MB ``` this PR: ``` xcl-smoke v1 commit: 5b2d568992cce45124d58d0396dcecea595072d1 gpu: NVIDIA GeForce RTX 4090 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1629 (PresentX 1629) presents per 2 s (last 3): 34 59 60 device removals: 0 crashes: 0 peak commit: 17788 MB ``` **Not tested** - AMD, other NVIDIA cards and drivers, Linux. I did not review the diff; this report is the build, the suite and the regression run only. *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.*
oni-swr commented 2026-11-25 15:08:00 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by oni-swr on 2026-11-25T14:49:30Z.


amd-win test report for head 5b2d568992cce45124d58d0396dcecea595072d1

Setup

  • AMD Radeon RX 7800 XT (driver 32.0.31035.1003), Ryzen 7 5700X3D, Windows 11 (build 26200), rustc 1.100.0, debug build for tests, release for smoke
  • Tested as a local merge of the PR head onto main 06c9f5505f63f10c5ec49ef932d75b2c28177324 (merge commit bf7c558c0fde86eaefa6780ccb011b2436324b23; it merged without conflicts). That is not the PR head itself, so the smoke block below names the merge commit.

Tests

  • cargo build --workspace then cargo test --workspace --no-fail-fast -- --test-threads=4: 1266 passed, 1 failed, 46 ignored, 7 SKIPPED lines (f16/f32 per-lane form, no heap windows)
  • The 1 failure is gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 (seed 722: res[30] GPU 0x1 vs CPU 0x7fffffff). It fails the same way on main (1264 passed, 1 failed, 46 ignored), so it is not caused by this PR.
  • The PR's new test hle::kbm::tests::a_window_attached_with_the_focus_takes_the_cursor passes.

Regression run (60 s, same title, networking off; main first, then the merge)

xcl-smoke v1  main 06c9f5505f63f10c5ec49ef932d75b2c28177324
frames shown: 1540, presents per 2 s (last 3): 60 60 60, device removals: 0, crashes: 0, peak commit: 16495 MB
xcl-smoke v1  merge bf7c558c0fde86eaefa6780ccb011b2436324b23
frames shown: 1583, presents per 2 s (last 3): 60 60 60, device removals: 0, crashes: 0, peak commit: 14849 MB

Exit code 0x0 on both. The full xcl-smoke blocks are not pasted because of the merge-commit caveat above.

Not tested

  • Not tested by hand: whether the cursor is taken at launch when the window has focus, and the title-bar click path (stacked on #973). Only the unit tests and a title run were done.
  • NVIDIA, wave32-only GPUs.

AI use: this run and report were done by Claude Code (Claude Sonnet 5.5).

<!-- greyfinch-sync:ivall/xcl:comment:7165872475 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/974#issuecomment-7165872475). Originally posted by [oni-swr](https://github.com/oni-swr) on 2026-11-25T14:49:30Z. --- **amd-win test report** for head `5b2d568992cce45124d58d0396dcecea595072d1` **Setup** - AMD Radeon RX 7800 XT (driver 32.0.31035.1003), Ryzen 7 5700X3D, Windows 11 (build 26200), rustc 1.100.0, debug build for tests, release for smoke - Tested as a local merge of the PR head onto `main` `06c9f5505f63f10c5ec49ef932d75b2c28177324` (merge commit `bf7c558c0fde86eaefa6780ccb011b2436324b23`; it merged without conflicts). That is not the PR head itself, so the smoke block below names the merge commit. **Tests** - `cargo build --workspace` then `cargo test --workspace --no-fail-fast -- --test-threads=4`: **1266 passed, 1 failed, 46 ignored**, 7 `SKIPPED` lines (f16/f32 per-lane form, no heap windows) - The 1 failure is `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1` (seed 722: `res[30]` GPU 0x1 vs CPU 0x7fffffff). It fails the same way on `main` (1264 passed, 1 failed, 46 ignored), so it is not caused by this PR. - The PR's new test `hle::kbm::tests::a_window_attached_with_the_focus_takes_the_cursor` passes. **Regression run** (60 s, same title, networking off; `main` first, then the merge) ``` xcl-smoke v1 main 06c9f5505f63f10c5ec49ef932d75b2c28177324 frames shown: 1540, presents per 2 s (last 3): 60 60 60, device removals: 0, crashes: 0, peak commit: 16495 MB xcl-smoke v1 merge bf7c558c0fde86eaefa6780ccb011b2436324b23 frames shown: 1583, presents per 2 s (last 3): 60 60 60, device removals: 0, crashes: 0, peak commit: 14849 MB ``` Exit code 0x0 on both. The full `xcl-smoke` blocks are not pasted because of the merge-commit caveat above. **Not tested** - Not tested by hand: whether the cursor is taken at launch when the window has focus, and the title-bar click path (stacked on #973). Only the unit tests and a title run were done. - NVIDIA, wave32-only GPUs. **AI use:** this run and report were done by Claude Code (Claude Sonnet 5.5).
DavidM1911 commented 2026-11-26 04:07:38 +00:00 (Migrated from github.com)

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

<!-- greyfinch-sync:ivall/xcl:comment:7181677405 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/974#issuecomment-7181677405). Originally posted by [DavidM1911](https://github.com/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
brainhay5 commented 2026-11-30 06:40:14 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by brainhay5 on 2026-11-30T06:40:14Z.


merge-check claim
head: 5b2d568992

<!-- greyfinch-sync:ivall/xcl:comment:7270886448 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/974#issuecomment-7270886448). Originally posted by [brainhay5](https://github.com/brainhay5) on 2026-11-30T06:40:14Z. --- merge-check claim head: 5b2d568992cce45124d58d0396dcecea595072d1
brainhay5 commented 2026-11-30 06:53:51 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by brainhay5 on 2026-11-30T06:53:51Z.


merge-check
base: d52ff48caa
head: 5b2d568992
merge: 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_d16 fails on base d52ff48c by itself (verified separately with the same command: "assertion failed: 2D D16 resinfo clobbered v2/v3"). Verdict corrected. Apologies for the noise.

<!-- greyfinch-sync:ivall/xcl:comment:7271128903 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/974#issuecomment-7271128903). Originally posted by [brainhay5](https://github.com/brainhay5) on 2026-11-30T06:53:51Z. --- merge-check base: d52ff48caade1f5350d513bfffd370396dadfeb6 head: 5b2d568992cce45124d58d0396dcecea595072d1 merge: 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_d16` fails on base d52ff48c by itself (verified separately with the same command: "assertion failed: 2D D16 resinfo clobbered v2/v3"). Verdict corrected. Apologies for the noise.
BBareth commented 2026-11-30 10:10:26 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by BBareth on 2026-11-30T10:10:26Z.


merge-check claim
head: 5b2d568992

<!-- greyfinch-sync:ivall/xcl:comment:7275229026 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/974#issuecomment-7275229026). Originally posted by [BBareth](https://github.com/BBareth) on 2026-11-30T10:10:26Z. --- merge-check claim head: 5b2d568992cce45124d58d0396dcecea595072d1
BBareth commented 2026-11-30 10:22:34 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by BBareth on 2026-11-30T10:22:34Z.


merge-check
base: 9dfbe3ea66
head: 5b2d568992
merge: 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, and title_bar_clicks_leave_the_cursor_free from #973).
review: no blocking finding; one file, both commits read. Stacked on #973: the merge result contains #973's commit 03d39a1b too, so this check covers the two together and #973 has to go in first (or with it). The top commit makes attach take 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 same cursor_hold decision 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.

<!-- greyfinch-sync:ivall/xcl:comment:7275504133 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/974#issuecomment-7275504133). Originally posted by [BBareth](https://github.com/BBareth) on 2026-11-30T10:22:34Z. --- merge-check base: 9dfbe3ea6653a9c76ef3ea0d66187a4b5407483b head: 5b2d568992cce45124d58d0396dcecea595072d1 merge: 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`, and `title_bar_clicks_leave_the_cursor_free` from #973). review: no blocking finding; one file, both commits read. Stacked on #973: the merge result contains #973's commit 03d39a1b too, so this check covers the two together and #973 has to go in first (or with it). The top commit makes `attach` take 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 same `cursor_hold` decision 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.
Foniass commented 2026-12-01 04:34:22 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:34:22Z.


Triage (#1607) – head 5b2d568

Stacked on #973: the first commit (03d39a1) is #973's, and only 5b2d568 belongs here, so the shared lines are not a duplicate. No other open or merged PR handles the WM_ACTIVATE that CreateWindowExW sends before kbm::attach.
attach now runs that activation through cursor_hold when GetForegroundWindow() == hwnd. That fits the window being created with WS_VISIBLE before 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.

<!-- greyfinch-sync:ivall/xcl:comment:7300869935 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/974#issuecomment-7300869935). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T04:34:22Z. --- **Triage (#1607)** – head 5b2d568 Stacked on #973: the first commit (03d39a1) is #973's, and only 5b2d568 belongs here, so the shared lines are not a duplicate. No other open or merged PR handles the `WM_ACTIVATE` that `CreateWindowExW` sends before `kbm::attach`. `attach` now runs that activation through `cursor_hold` when `GetForegroundWindow() == hwnd`. That fits the window being created with `WS_VISIBLE` before 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.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/974:upstream-pr/974'
git switch 'upstream-pr/974'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/974'
git switch 'upstream-pr/974'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/974'
git switch 'upstream-pr/974'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/974'
git switch 'main'
git merge --squash 'upstream-pr/974'
git switch 'main'
git merge --ff-only 'upstream-pr/974'
git switch 'main'
git merge 'upstream-pr/974'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!968
No description provided.