[pr-fix][startup] Alt+Enter back to a window keeps the window visible #141
Loading…
Reference in a new issue
No description provided.
Delete branch "Jesper-A/Darner:up-altenter-visible"
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?
Refs #136
Contributor role (optional)
What it changes
Pressing Alt+Enter in the borderless full screen that Darner applies at the start (
DARNER_FULLSCREEN) could hide the window: it went white and then vanished from the taskbar and Alt+Tab, while the game kept running (details in #136).Cause, as read from the code and from the window style seen in #136 (not confirmed by a live test after the fix): borderless can be applied right when the window is created, before the title shows it. The style saved then has no
WS_VISIBLE. The way back to a window put that saved style back as it was, which hid the window.The fix is in
crates/darner-hle/src/modules/lifecycle.rs(+19/-1):restored_style(saved, current):(saved & !WS_VISIBLE) | (current & WS_VISIBLE). It restores the saved style but keeps the window's current visibility.toggle_fullscreenreads the current style and passes it torestored_style.restored_style_keeps_the_current_visibility.There is no new switch: it only repairs a broken toggle, so the behaviour it changes is the bug itself.
How it was tested
2cb9f85f0(branchup-altenter-visible, onmain57dea7f23).--locked -j 4, on2cb9f85f0):cargo test -p darner-hle --lib modules::lifecycle: 22 passedcargo clippy --workspace --all-targets -- -D warnings: cleancargo xtask policy: ok0x04CF0000withoutWS_VISIBLE; that is the only "before" evidence.cargo clippy --workspace --all-targets --all-features --locked -- -D warnings,cargo test --workspace --locked, and any game run. There is no CI upstream, so none of this was checked by CI. Hardware for the original report: RTX 2070 SUPER 8 GB (Turing), driver 621.40, ReBAR off, Ryzen 7 5800X, 32 GB, Windows 11 Pro Insider 26320, Series S, DLSS Performance. Other Windows builds and GPUs are untested.Spec dependence:
Checklist
main.docs/asset-policy.md.Checked for overlap
crates/darner-hle/src/modules/lifecycle.rs(+21/-0, an ultrawide option). Its lines are infullscreen()and the tests, not intoggle_fullscreen; a trial merge with it conflicts in that file; this is a WIP draft posted as it is, and whichever lands second needs a small rebase.This change was made with AI assistance (Claude Code).
[pr-fix][startup] WIP: Alt+Enter back to a window keeps the window visibleto WIP: [pr-fix][startup] Alt+Enter back to a window keeps the window visibleWIP: [pr-fix][startup] Alt+Enter back to a window keeps the window visibleto [pr-fix][startup] Alt+Enter back to a window keeps the window visibleTested on an RTX 4080 / Ryzen 9 7900 / Windows 11 Home 26200 (details in #136, where the release exe hides the window on the 1st Alt+Enter and keeps it hidden on the 2nd).
Build:
2cb9f85, a release build of this branch (cargo build --release -p darner, names itselfv2026.12.03.01-23). Settings: Series X, 4K output, DLSS Performance, frame generation 2x, ray tracing off, borderless at start. Steps: at the account picker, Alt+Enter twice, reading the window withGetWindowLongW(GWL_STYLE)andIsWindowVisibleafter each (rectangles in 150 % scaled coordinates):0x940000000x14CF00000x94000000The window keeps
WS_VISIBLEgoing to windowed and coming back, so both the hiding and the stuck second Alt+Enter are fixed here. I checked the window state only: my screen capture tool couldn't show this build's window, so I haven't looked at the picture itself. Not tested: starting with borderless off, and theDARNER_FULLSCREEN_BARSbackdrop.Closing: replaced by
a917f992fon main ("lifecycle: Alt+Enter out of borderless keeps the window shown (#136)"), which fixes the same call site the same way (the restored style keeps the window's current WS_VISIBLE) and has its own test. This branch now conflicts with it in lifecycle.rs. Thanks to Trillazill for testing this branch on #136 (the window kept WS_VISIBLE through both Alt+Enter presses); the same logic is now on main.Drafted with AI assistance (Claude Code).
Pull request closed