XCL window: window_pos setting; free the cursor while dragging the window #176

Manually merged
github merged 2 commits from gh-pr/176/head into gh-pr/176/base 2026-11-26 04:13:45 +00:00
Owner

@⁠ryosen0 on GitHub · 2026-11-23 18:58 UTC · original
ryosen0:window-position → main · +118 −5 · 3 files · 2 commits · merged 2026-11-23 21:08 UTC

Two related window fixes, both reproduced on a 4-monitor desktop (one portrait 440x1920).

1. window_pos setting (commit 1). The XCL window was created with CW_USEDEFAULT for its position; Windows may place it on any monitor — observed landing on the portrait side monitor, mostly off-screen. New window_pos in xcl.toml (XCL_WINDOW_POS overrides): "auto" (default, unchanged), "center" (primary work area), "x,y" (clamped into the nearest monitor's work area). Verified: with "center" the rect is (312,160)-(1608,919) on the primary 1920x1080.

2. Cursor teleport while dragging the window (commit 2). While the window has the focus, kbm clips the cursor to the client centre (the mouse plays the right stick). WM_MOVE re-clipped it during a title-bar drag: the cursor teleported back to the moving centre mid-drag and broke the drag. Now WM_ENTERSIZEMOVE releases the clip for the whole drag/resize loop and WM_EXITSIZEMOVE restores it. Verified interactively: the window drags smoothly, the cursor stays hidden in the client area otherwise.

Tests: window_position_modes (all modes, clamp, env override), kbm suite 7 passed.

**@⁠ryosen0** on GitHub · 2026-11-23 18:58 UTC · [original](https://github.com/xcl-dev/xcl/pull/176) `ryosen0:window-position` → `main` · +118 −5 · 3 files · 2 commits · merged 2026-11-23 21:08 UTC Two related window fixes, both reproduced on a 4-monitor desktop (one portrait 440x1920). **1. `window_pos` setting (commit 1).** The XCL window was created with `CW_USEDEFAULT` for its position; Windows may place it on any monitor — observed landing on the portrait side monitor, mostly off-screen. New `window_pos` in xcl.toml (`XCL_WINDOW_POS` overrides): `"auto"` (default, unchanged), `"center"` (primary work area), `"x,y"` (clamped into the nearest monitor's work area). Verified: with `"center"` the rect is (312,160)-(1608,919) on the primary 1920x1080. **2. Cursor teleport while dragging the window (commit 2).** While the window has the focus, kbm clips the cursor to the client centre (the mouse plays the right stick). `WM_MOVE` re-clipped it *during* a title-bar drag: the cursor teleported back to the moving centre mid-drag and broke the drag. Now `WM_ENTERSIZEMOVE` releases the clip for the whole drag/resize loop and `WM_EXITSIZEMOVE` restores it. Verified interactively: the window drags smoothly, the cursor stays hidden in the client area otherwise. Tests: `window_position_modes` (all modes, clamp, env override), kbm suite 7 passed.
The window was created with CW_USEDEFAULT for its position, so on a multi-monitor desktop Windows may place it on any monitor (observed: a 4-monitor setup, the window landed on the narrow portrait side monitor). window_pos (XCL_WINDOW_POS overrides): auto keeps the old behavior, center centers on the primary work area, x,y clamps into the nearest monitor work area. Test: window_position_modes covers all modes, the clamp, and the env override.
While the XCL window has the focus its cursor is clipped to the client centre (the mouse plays the right stick). WM_MOVE re-clipped it during a drag: the cursor teleported back to the (moving) centre mid-drag, breaking the drag. Track WM_ENTERSIZEMOVE/WM_EXITSIZEMOVE: release the clip for the whole drag/resize loop, restore it after. kbm tests pass (7).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:13:44 +00:00
github manually merged commit a6e52be347 into gh-pr/176/base 2026-11-26 04:13:45 +00:00
Author
Owner

@⁠ivall on GitHub · 2026-11-23 21:09 UTC · original

Merged (main 6da33fa). Checked on an RX 9070 (RDNA4) with the 22 PRs merged together on main eaa36b6: cargo build --workspace && cargo test --workspace -- --test-threads=4 - 582 unit tests passed, 0 failed (20 ignored), the integration and e2e tests passed too; and the retail game still reaches its first menu (646 frames in 30 s, no device removal).

**@⁠ivall** on GitHub · 2026-11-23 21:09 UTC · [original](https://github.com/xcl-dev/xcl/pull/176#issuecomment-7114075113) Merged (main 6da33fa). Checked on an RX 9070 (RDNA4) with the 22 PRs merged together on main eaa36b6: `cargo build --workspace && cargo test --workspace -- --test-threads=4` - 582 unit tests passed, 0 failed (20 ignored), the integration and e2e tests passed too; and the retail game still reaches its first menu (646 frames in 30 s, no device removal).
This discussion has been locked. Commenting is limited to contributors.
No description provided.