Skip to content

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

Merged
ivall merged 2 commits into
xcl-dev:mainfrom
ryosen0:window-position
Nov 23, 2026
Merged

ivall merged 2 commits into
xcl-dev:mainfrom
ryosen0:window-position

Conversation

@ryosen0

@ryosen0 ryosen0 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

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.

…lamped x,y

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).
@ryosen0 ryosen0 changed the title XCL window: window_pos setting – center on the primary monitor or a clamped x,y XCL window: window_pos setting; free the cursor while dragging the window Nov 23, 2026
@ivall
ivall merged commit 8dd9020 into xcl-dev:main Nov 23, 2026
@ivall

ivall commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants