d3d12: Alt+Enter switches to borderless fullscreen instead of freezing the picture (D3D12-BORDERLESS-FULLSCREEN) #2752
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!2752
Loading…
Reference in a new issue
No description provided.
Delete branch "d3d12/borderless-fullscreen"
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?
Pull request successfully merged and closed
Claimed in the coordination issue as: D3D12-BORDERLESS-FULLSCREEN (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7258292257)
What and why
In
d3d12/, Alt+Enter went to DXGI's own exclusive fullscreen. Nothing in the runtime makes the buffers again for it, so the picture froze and nothing more was shown.leonida-gpu/src/host.rs: after the swap chain is made,MakeWindowAssociation(hwnd, DXGI_MWA_NO_ALT_ENTER)is called on the swap chain's own factory (GetParent), so DXGI leaves Alt+Enter alone.leonida-hle/src/modules/lifecycle.rs, the title window's procedure:MonitorFromWindow/rcMonitor).WM_NCDESTROY.WS_CHILD) is left as it was, and Alt+Enter goes on to it.LEONIDA_FULLSCREEN=1(-Fullscreenin both launchers, or FULLSCREEN (NO BORDER) in the F1 menu) makes the window borderless from the start.LEONIDA_PRESENT_SCALE).VIctory has a borderless fullscreen, which gave the idea; this code is written for
leonida-hle. RT-WINDOW-MODES (#14) is aboutruntime/'s windows and has no pull request; this changesd3d12/only.Tested
main):-Fullscreenand FSR 3 frame generation on, the window started borderless over the 1920x1080 monitor.cargo test -p leonida-hle --lib lifecycle, 15 passed, with five new tests that send the keys to windows of their own and run one at a time:cargo clippyreports nothing inlifecycle.rs,scripts\build-nvidia.ps1builds and both launchers parse, on the branch rebased onto08e42a516.GPUs tested: NVIDIA GeForce RTX 3060 12 GB, driver 621.40, Windows 11 Pro (build 26300)
AI-assisted: yes (Claude Code, Claude Opus 5.5)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (No translator change.)🤖 Generated with Claude Code
Independent Wine check of Alt+Enter with multiple windows
MEASURED. I cross-built the unchanged
lifecycle.rsfrom85f4ca8bagainst the Windows SDK with Rust 1.98.1 and ran it on Wine 11.22 with a private 1024×768 Xvfb display. A small harness stubbed unrelated GPU and loader interfaces and drove the hooked windows with syntheticSendMessageWcalls. The 12 stock lifecycle tests passed, including the two new fullscreen tests.[0, 0, 1024, 768]instead of restoring[30, 40, 350, 240]. The assignment to the singleWINDOWEDslot saves B over A.WS_CHILD | WS_BORDERwindow changed its bounds from[49, 110, 369, 310]to[29, 70, 1053, 838]and its style from0x40800000to0xc0000000. The same case onmainbe769080left the child unchanged. The startup path already checksWS_CHILD. The hotkey path reachesset_borderlessfor this child.WM_SYSCHARwere consumed. The synthetic previous procedure received oneWM_SYSKEYDOWNwithlParam=0x60000000for the held key. The frame stayed borderless during the repeat, which is what the stock test checks.Each failure reproduced in isolation. In a local test-only control I stored the saved state per HWND, excluded
WS_CHILDfrom the hotkey and consumed repeats without toggling. All 15 tests then passed. A second agent independently reran the cases using a separate Wine prefix and Xvfb. This checks Win32 message handling and window state under Wine. Native Windows input and DXGI presentation were outside the test. AI-assisted with OpenAI Codex.@merzleckeier thanks for the Wine check. I confirmed all three findings in the code, and they are fixed in
6bc847d0b, with one test each:WINDOWEDis now one entry per window (Vec<Windowed>keyed by HWND), so A, B, B, A brings each window back to its own frame and place. An entry is also dropped atWM_NCDESTROY, because a later window can get the same handle. Test:two_windows_keep_their_own_places.WS_CHILDwindow alone. Its Alt+Enter and EnterWM_SYSCHARgo on to it as onmain, andset_borderlessitself refuses to make a child borderless. Test:a_child_window_is_left_alone, which checks that the window keeps its rect and style.alt_enternow tells a press from a repeat (bit 30), and window_proc consumes both. A repeat neither switches the window nor reaches the previous procedure. Test:a_held_alt_enter_does_not_reach_the_title. It swaps a counting procedure in for the title's, then sends one Alt+Enter and three repeats, and counts zeroWM_SYSKEYDOWN. Another Alt key still gets through.The branch is also rebased onto
08e42a516, which resolves theneeds rebaseconflicts inhost.rs(next to the newshown::install) and in theplay-nvidia.ps1switch list (now withMotionBlur).Re-run on native Windows 11 (RTX 3060, driver 621.40):
cargo test -p leonida-hle --lib lifecyclegives 15 passed, including your three cases.cargo clippyreports nothing inlifecycle.rs.scripts\build-nvidia.ps1builds, and both launchers parse.The in-game run in the description was made before these fixes. They change nothing for the title's one top-level window or a single press.
AI-assisted (Claude Code, Claude Opus 5.5).