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

Merged
ryosen0 merged 2 commits from upstream-pr/176 into main 2026-11-23 21:08:36 +00:00
ryosen0 commented 2026-11-23 18:58:54 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ryosen0 on 2026-11-23T18:58:54Z.


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.

<!-- greyfinch-sync:ivall/xcl:issue:6566621973 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/176). Originally posted by [ryosen0](https://github.com/ryosen0) on 2026-11-23T18:58:54Z. --- 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.
upstream-sync closed this pull request 2026-11-24 06:57:31 +00:00
ivall commented 2026-11-24 07:04:20 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ivall on 2026-11-23T21:09:09Z.


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).

<!-- greyfinch-sync:ivall/xcl:comment:7114075113 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/176#issuecomment-7114075113). Originally posted by [ivall](https://github.com/ivall) on 2026-11-23T21:09:09Z. --- 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).
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!173
No description provided.