metal, window: a minimised or covered window presents nothing instead of stalling #342
No reviewers
Labels
No labels
accessibility
bug
claimed
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
tester report
urgent
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LakshanSivakumar--Native-Victory-macOS!342
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-341"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@derz92 on GitHub · 2026-11-27 13:02 UTC · original
derz92:fix/hidden-window-presents→main· +55 −0 · 3 files · 1 commits · merged 2026-11-27 16:14 UTCWhat this changes
Refs #333.
While the game window is minimised or wholly covered, a present no longer waits for a drawable.
victory_metal::present::try_presentcounts the frame as shown and draws nothing, as in a headless run. The window's event loop reports its visibility each pass:isMiniaturized, orocclusionStatewithoutNSWindowOcclusionStateVisible. It does that throughvictory_gpu::set_window_hidden, a re-export ofvictory_metal::present::set_window_hidden, so the app gains no dependency andCargo.lockdoesn't change. A drawable acquisition already in flight is still taken. When the window can be seen again, presents go back to the layer. The change is logged once each way (present: the window's visibility changed hidden=…).How it was tested
Apple M5 Max, 36 GB, macOS 26.5, windowed,
--console series-s,VICTORY_COUNT_GREEN=1. The window was minimised from outside with System Events (AXMinimized) 12 s into the run and restored 30 s later:hidden=trueat 12:28:37,hidden=falseat 12:29:07. Presents kept going all the time it was minimised (22–30 per second), it drew normally once restored, and the run went on into the story load with no fault.Checks:
cargo test -p victory-metal --lib present(arm64): 3 passed. The new test isa_hidden_window_presents_without_a_drawable: with a drawable worker that never answers, three hidden presents returnOk(true)and count, and once visible again the present waits as before. Both present tests now take a lock, since the flag is process-wide.cargo test --target x86_64-apple-darwin -p victory-hle -p victory-loader -p victory: all pass excepthost_posix::ucrt::tests::dlls_that_are_not_the_c_runtime_are_left_alone, which fails the same way on main at86786a72.cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warningscargo xtask policyChecklist
VICTORY_*variable and documented (no new diagnostics)github-bot referenced this pull request2026-11-27 13:39:05 +00:00
3becae7052to7fecf663cf@LakshanSivakumar on GitHub · 2026-11-27 16:15 UTC · original
Merged in
4cf84c83. Before pushing I ran the tests (native arm64), Windows clippy, the policy check, a release build, and one headless game run of the exact tree (170 s, Series S): menus at 30 fps, the world entered at about 81 s and kept presenting to the end at about 1 frame a second, 0 GPU errors, no crash. The run was headless, so I did not try minimising a window. Thanks.