Window and input: fullscreen, English IME, and a mouse capture that leaves the pointer alone #14

Closed
github-bot wants to merge 1 commit from github-bot/gh-14 into main AGit
Owner

@⁠superboynick on GitHub · 2026-11-27 02:46 UTC · original
superboynick:pr/mouse-capture-fix → main · +341 −6 · 2 files · 1 commits · closed without merging

Window and input work that a player notices before anything else. Three switches, each defaulting to 1 and each set to 0 restoring the behaviour before this change.

Fullscreen (VICTORY_FULLSCREEN): borderless window at the display's size with its frame removed; VICTORY_FULLSCREEN_RES=1920x1080 picks another size. The swap chain is untouched — this fork's chain is 3840x2160 whatever the window says — so presenting does not change.

English input method (VICTORY_IME_ENGLISH): the window's input context is switched to en-US at start-up, because a Chinese IME in the game turns key presses into candidate windows. When the layout is not installed it logs once and does nothing else.

Mouse capture (VICTORY_MOUSE_CAPTURE): the pointer is clipped to the client area and hidden while our window has focus, released on focus loss. This also fixes a mistake in the mouse device merged as #9: that code warped the pointer back to the centre after every sample, which pins the absolute position the title reads, so the camera looks frozen — "mouse capture does not work at all", as the player reported. Warping is now a separate switch, VICTORY_MOUSE_WARP=0 by default; with it on, the delta is taken from the centre rather than the previous sample, so turning keeps working past the screen edge without pointer drift.

Measured on an RTX 5070 Ti Laptop (12 GB, 32-lane waves), Windows 11: window rect 0,0–1920,1080, client area the same, GetClipCursor returning the same rectangle, title in front.

cargo build --release -p victory, cargo build --profile diag -p victory --features diagnostics, and cargo test -p victory-hle (158 passed, 2 ignored) pass.

Written with an AI assistant.

**@⁠superboynick** on GitHub · 2026-11-27 02:46 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/14) `superboynick:pr/mouse-capture-fix` → `main` · +341 −6 · 2 files · 1 commits · closed without merging Window and input work that a player notices before anything else. Three switches, each defaulting to 1 and each set to 0 restoring the behaviour before this change. **Fullscreen** (`VICTORY_FULLSCREEN`): borderless window at the display's size with its frame removed; `VICTORY_FULLSCREEN_RES=1920x1080` picks another size. The swap chain is untouched — this fork's chain is 3840x2160 whatever the window says — so presenting does not change. **English input method** (`VICTORY_IME_ENGLISH`): the window's input context is switched to en-US at start-up, because a Chinese IME in the game turns key presses into candidate windows. When the layout is not installed it logs once and does nothing else. **Mouse capture** (`VICTORY_MOUSE_CAPTURE`): the pointer is clipped to the client area and hidden while our window has focus, released on focus loss. This also fixes a mistake in the mouse device merged as #9: that code warped the pointer back to the centre after every sample, which pins the absolute position the title reads, so the camera looks frozen — "mouse capture does not work at all", as the player reported. Warping is now a separate switch, `VICTORY_MOUSE_WARP=0` by default; with it on, the delta is taken from the centre rather than the previous sample, so turning keeps working past the screen edge without pointer drift. Measured on an RTX 5070 Ti Laptop (12 GB, 32-lane waves), Windows 11: window rect 0,0–1920,1080, client area the same, `GetClipCursor` returning the same rectangle, title in front. `cargo build --release -p victory`, `cargo build --profile diag -p victory --features diagnostics`, and `cargo test -p victory-hle` (158 passed, 2 ignored) pass. Written with an AI assistant.
Three things a player notices before anything else.

**Fullscreen** (`VICTORY_FULLSCREEN=1`, borderless by default): the window takes the
display's size with its frame removed, and `VICTORY_FULLSCREEN_RES=1920x1080` picks
another size. The swap chain is untouched - this fork's chain is 3840x2160 whatever
the window says - so nothing about presenting changes.

**English input method** (`VICTORY_IME_ENGLISH=1`): the window's input context is
switched to en-US at start-up, because a Chinese IME in the game turns every key
press into candidate-window noise. When the layout is not installed it logs once and
does nothing else.

**Mouse capture** (`VICTORY_MOUSE_CAPTURE=1`): the pointer is clipped to the client
area and hidden while our window has focus, and released on focus loss. This fixes a
mistake in the mouse device that went in as pull request #9: that code also warped the
pointer back to the centre after every sample, which pins the absolute position the
title reads and makes the camera look frozen - "mouse capture does not work at all",
as the player put it. Warping is now a separate switch, `VICTORY_MOUSE_WARP=0` by
default; with it on, the delta is taken from the centre rather than from the previous
sample, so turning keeps working past the edge of the screen without the pointer
drift.

Each switch set to 0 restores exactly the behaviour before this change. Measured on an
RTX 5070 Ti Laptop (12 GB, 32-lane waves), Windows 11: window rect 0,0-1920,1080 with a
client area of the same size, `GetClipCursor` returning the same rectangle, and the
title in front.

`cargo build --release -p victory`, `cargo build --profile diag -p victory --features
diagnostics` and `cargo test -p victory-hle` (158 passed, 2 ignored) pass.

Written with an AI assistant.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 02:48:51 +00:00
github-bot closed this pull request 2026-11-27 04:15:16 +00:00
Author
Owner

@⁠superboynick on GitHub · 2026-11-27 04:12 UTC · original

Superseded by the branch built on today's main; that one applies cleanly.

**@⁠superboynick** on GitHub · 2026-11-27 04:12 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/14#issuecomment-7209608990) Superseded by the branch built on today's main; that one applies cleanly.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.