Skip to content

fix(alttab-fullscreen): patch SetFullscreenState to actually keep us windowed#28

Merged
northaxosky merged 1 commit into
masterfrom
hotfix/alttab-fullscreen-setfullscreen-block
May 24, 2026
Merged

fix(alttab-fullscreen): patch SetFullscreenState to actually keep us windowed#28
northaxosky merged 1 commit into
masterfrom
hotfix/alttab-fullscreen-setfullscreen-block

Conversation

@northaxosky
Copy link
Copy Markdown
Contributor

@northaxosky northaxosky commented May 24, 2026

Fix

Vtable-hook slot 10 (SetFullscreenState) on the IDXGISwapChain returned from D3D11CreateDeviceAndSwapChain. a_fullscreen == TRUE calls on the game's HWND are short-circuited to S_OK without forwarding. Everything else forwards untouched.

Details

  • Scoped by HWND inside the hook: ReShade/ENB/High fps physics fix swap chains that share the vtable get their calls forwarded normally.
  • OriginalSetFullscreenState is published to std::atomic before calling DetourVTable, so a thread that catches the patched vtable never sees a null original.
  • Patch is once-only via compare_exchange_strong; rolls back on failure.
  • MakeWindowAssociation HRESULT now logged on failure (was silently swallowed).
  • Existing Windowed=TRUE rewrite and MakeWindowAssociation calls preserved as belt-and-suspenders.

MakeWindowAssociation only catches DXGI's auto alt-enter; explicit calls
bypassed it. Vtable-hook slot 10 on the returned swap chain, scoped to
the game HWND so other mods' swap chains forward untouched.
@northaxosky northaxosky force-pushed the hotfix/alttab-fullscreen-setfullscreen-block branch from d66c4e5 to 5c7e224 Compare May 24, 2026 02:29
@northaxosky northaxosky merged commit 128c71c into master May 24, 2026
1 check passed
@northaxosky northaxosky deleted the hotfix/alttab-fullscreen-setfullscreen-block branch May 24, 2026 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant