Window: VICTORY_WINDOW_BACKGROUND=1 opens the window without the foreground, behind others, past the desktop's right edge #1136

Closed
exotiquee wants to merge 1 commit from upstream-pr/1139 into main
exotiquee commented 2026-11-25 21:23:13 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by exotiquee on 2026-11-25T21:23:13Z.


Branch: pr/window-background (1 commit on main 085ee7c)

What it does

For unattended runs on a PC someone is working at. With the switch, the title's top-level window (and the layer's own window, when it makes one) is created without WS_VISIBLE, then shown at the bottom of the z order, just right of the virtual desktop, without activation. It still renders and presents, and scripted keys work without focus.

Files: crates/victory-hle/src/modules/lifecycle.rs (the title's CreateWindowExW/A), crates/victory-gpu/src/host.rs (make_window).

Switch

VICTORY_WINDOW_BACKGROUND=1. Off by default. Without it nothing changes.

Tests

No new test: it only changes window placement.

  • cargo +1.98.1 test --locked -j 4 -p victory-gpu -p victory-hle, with and without --features victory-gpu/diagnostics: victory-gpu 183 passed (200 with diagnostics), victory-hle 100 passed.
  • One run hit modules::xmem::tests::a_read_in_place_never_meets_the_gap_of_a_remapping failing (the reader thread made 0 reads while the machine was loaded). The test passed 3 of 3 times when run alone. It is a timing test in code this PR does not touch.
  • Builds clean: no new compiler or clippy warnings against main.

What we measured (RTX 5080, Ryzen 7 9800X3D)

Frame-rate effect not measured; none is expected. Three caveats for anyone timing with it:

  • Card-busy numbers from a hidden window are not comparable with numbers from a visible one. In one pair of runs the card was 64% busy hidden and 79% busy visible. That pair also differed in one other switch, so the gap is not proven to come from the window or the compositor.
  • PrintWindow screenshots of the hidden window come back blank. Use the layer's own frame capture instead.
  • One crash, in title code, showed up only in hidden runs. It was later traced to an unrelated switch (a ~20 s stall in a loading frame), not to this one.

Risks

Small. Only the top-level window's creation style and position change, and only with the switch on. Child windows are left alone.

🤖 Generated with Claude Code

<!-- greyfinch-sync:fxceless/victory-fork:issue:5499405867 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1139). Originally posted by [exotiquee](https://github.com/exotiquee) on 2026-11-25T21:23:13Z. --- Branch: `pr/window-background` (1 commit on `main` 085ee7c) ## What it does For unattended runs on a PC someone is working at. With the switch, the title's top-level window (and the layer's own window, when it makes one) is created without `WS_VISIBLE`, then shown at the bottom of the z order, just right of the virtual desktop, without activation. It still renders and presents, and scripted keys work without focus. Files: `crates/victory-hle/src/modules/lifecycle.rs` (the title's `CreateWindowExW/A`), `crates/victory-gpu/src/host.rs` (`make_window`). ## Switch `VICTORY_WINDOW_BACKGROUND=1`. **Off by default.** Without it nothing changes. ## Tests No new test: it only changes window placement. - `cargo +1.98.1 test --locked -j 4 -p victory-gpu -p victory-hle`, with and without `--features victory-gpu/diagnostics`: victory-gpu 183 passed (200 with diagnostics), victory-hle 100 passed. - One run hit `modules::xmem::tests::a_read_in_place_never_meets_the_gap_of_a_remapping` failing (the reader thread made 0 reads while the machine was loaded). The test passed 3 of 3 times when run alone. It is a timing test in code this PR does not touch. - Builds clean: no new compiler or clippy warnings against `main`. ## What we measured (RTX 5080, Ryzen 7 9800X3D) Frame-rate effect not measured; none is expected. Three caveats for anyone timing with it: - Card-busy numbers from a hidden window are not comparable with numbers from a visible one. In one pair of runs the card was 64% busy hidden and 79% busy visible. That pair also differed in one other switch, so the gap is not proven to come from the window or the compositor. - `PrintWindow` screenshots of the hidden window come back blank. Use the layer's own frame capture instead. - One crash, in title code, showed up only in hidden runs. It was later traced to an unrelated switch (a ~20 s stall in a loading frame), not to this one. ## Risks Small. Only the top-level window's creation style and position change, and only with the switch on. Child windows are left alone. 🤖 Generated with [Claude Code](https://claude.com/claude-code)

Pull request closed

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
fxceless/victory-fork!1136
No description provided.