feat(hle): add opt-in hidden window mode for lifecycle stand-in #3282

Open
legayclightning22 wants to merge 1 commit from upstream-pr/3284 into main
legayclightning22 commented 2026-11-26 15:49:47 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by legayclightning22 on 2026-11-26T15:49:47Z.


Summary

Adds an opt-in hidden-window presentation mode in crates/victory-hle/src/modules/lifecycle.rs so unattended or background runs do not interfere with desktop focus or taskbar state while keeping swap-chain presentation active.

Changes

  • When VICTORY_HIDDEN_WINDOW=1 is set, top-level windows created via CreateWindowExW/CreateWindowExA receive WS_EX_TOOLWINDOW | WS_EX_NOACTIVATE and are positioned off-screen at (-32000, -32000) without altering swap-chain presentation.
  • Add unit tests covering hidden-window style and coordinate transformation.

Verification

  • cargo check -p victory-hle --all-targets
  • cargo clippy --locked -p victory-hle --all-targets -- -D warnings
  • cargo test -p victory-hle --lib
  • cargo xtask policy
<!-- greyfinch-sync:Marvisak/VIctory:issue:6630287195 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3284). Originally posted by [legayclightning22](https://github.com/legayclightning22) on 2026-11-26T15:49:47Z. --- ## Summary Adds an opt-in hidden-window presentation mode in `crates/victory-hle/src/modules/lifecycle.rs` so unattended or background runs do not interfere with desktop focus or taskbar state while keeping swap-chain presentation active. ## Changes - When `VICTORY_HIDDEN_WINDOW=1` is set, top-level windows created via `CreateWindowExW`/`CreateWindowExA` receive `WS_EX_TOOLWINDOW | WS_EX_NOACTIVATE` and are positioned off-screen at `(-32000, -32000)` without altering swap-chain presentation. - Add unit tests covering hidden-window style and coordinate transformation. ## Verification - `cargo check -p victory-hle --all-targets` - `cargo clippy --locked -p victory-hle --all-targets -- -D warnings` - `cargo test -p victory-hle --lib` - `cargo xtask policy`
cloph-dsp commented 2026-11-26 16:00:34 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-26T16:00:34Z.


Independent Windows verification. Head 434c475, Rust 1.100.0/MSVC, worktree-local CARGO_TARGET_DIR (target-3284), no game data.

  • cargo test --locked -p victory-hle --lib -- --exact modules::lifecycle::tests::hidden_window_mode_leaves_normal_windows_alone modules::lifecycle::tests::hidden_window_mode_moves_and_hides_window_without_touching_size -> 2 passed, 0 failed, 152 filtered, exit 0.
  • git diff --check origin/main HEAD clean; both test names absent on merge base 63bcca4.
  • Caveat: these are synthetic helper tests; I did not create real windows or check desktop focus/taskbar/swap-chain behaviour.

AI-assisted (Hy4 flash). GPU/driver N/A (CPU-only HLE tests). No game data.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7197055226 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3284#issuecomment-7197055226). Originally posted by [cloph-dsp](https://github.com/cloph-dsp) on 2026-11-26T16:00:34Z. --- Independent Windows verification. Head 434c475, Rust 1.100.0/MSVC, worktree-local CARGO_TARGET_DIR (target-3284), no game data. - `cargo test --locked -p victory-hle --lib -- --exact modules::lifecycle::tests::hidden_window_mode_leaves_normal_windows_alone modules::lifecycle::tests::hidden_window_mode_moves_and_hides_window_without_touching_size` -> 2 passed, 0 failed, 152 filtered, exit 0. - `git diff --check origin/main HEAD` clean; both test names absent on merge base 63bcca4. - Caveat: these are synthetic helper tests; I did not create real windows or check desktop focus/taskbar/swap-chain behaviour. AI-assisted (Hy4 flash). GPU/driver N/A (CPU-only HLE tests). No game data.
Dukestar69 commented 2026-11-26 16:10:43 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T16:10:43Z.

Review: APPROVED


Reviewed the diff and verified locally on Windows 11 x64:

  • Standalone opt-in VICTORY_HIDDEN_WINDOW=1 cleanly adds WS_EX_TOOLWINDOW | WS_EX_NOACTIVATE and moves the stand-in window offscreen without altering default behavior when unset. (Note: overlaps the lifecycle.rs hunk in #3271.)
  • cargo test -p victory-hle --lib modules::lifecycle:: -- --test-threads=1: 14 passed, 0 failed (including hidden_window_mode_leaves_normal_windows_alone and hidden_window_mode_moves_and_hides_window_without_touching_size).
  • cargo clippy -p victory-hle --all-targets -- -D warnings: clean.
  • cargo xtask policy: 191 files ok.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6077311373 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3284#pullrequestreview-6077311373). Originally posted by [Dukestar69](https://github.com/Dukestar69) on 2026-11-26T16:10:43Z. **Review:** APPROVED --- Reviewed the diff and verified locally on Windows 11 x64: - Standalone opt-in `VICTORY_HIDDEN_WINDOW=1` cleanly adds `WS_EX_TOOLWINDOW | WS_EX_NOACTIVATE` and moves the stand-in window offscreen without altering default behavior when unset. (Note: overlaps the `lifecycle.rs` hunk in #3271.) - `cargo test -p victory-hle --lib modules::lifecycle:: -- --test-threads=1`: 14 passed, 0 failed (including `hidden_window_mode_leaves_normal_windows_alone` and `hidden_window_mode_moves_and_hides_window_without_touching_size`). - `cargo clippy -p victory-hle --all-targets -- -D warnings`: clean. - `cargo xtask policy`: 191 files ok. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
legayclightning22 commented 2026-11-26 16:21:23 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by legayclightning22 on 2026-11-26T16:21:23Z.


Rebased cleanly onto upstream/main and verified cargo test -p victory-hle --lib (154 passed), cargo clippy --locked -p victory-hle --all-targets -- -D warnings, and cargo xtask policy.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7197533711 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3284#issuecomment-7197533711). Originally posted by [legayclightning22](https://github.com/legayclightning22) on 2026-11-26T16:21:23Z. --- Rebased cleanly onto `upstream/main` and verified `cargo test -p victory-hle --lib` (154 passed), `cargo clippy --locked -p victory-hle --all-targets -- -D warnings`, and `cargo xtask policy`.
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/3284:upstream-pr/3284'
git switch 'upstream-pr/3284'

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/3284'
git switch 'upstream-pr/3284'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3284'
git switch 'upstream-pr/3284'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3284'
git switch 'main'
git merge --squash 'upstream-pr/3284'
git switch 'main'
git merge --ff-only 'upstream-pr/3284'
git switch 'main'
git merge 'upstream-pr/3284'
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
Marvisak/VIctory!3282
No description provided.