Skip to content

fix: only ask Steam's own windows to close when going back to the PC - #140

Merged
lippdev merged 2 commits into
mainfrom
fix/restore-never-closes-game
Oct 5, 2026
Merged

lippdev merged 2 commits into
mainfrom
fix/restore-never-closes-game

Conversation

@lippdev

@lippdev lippdev commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Problem

LaunchService.CloseBigPicture posts WM_CLOSE to whatever GetBigPictureHandles returns, and that accepts any full-screen window of class SDL_app, from any process. A game built on SDL (Source 2 titles, many indies) running borderless full screen can be picked as "Big Picture" and be asked to close when the user goes back to the PC, possibly with unsaved progress.

Fix

The close request is only posted to windows owned by steam / steamwebhelper; anything else is left open and logged. Detection (GetBigPictureHandles) is unchanged on purpose, so session tracking behaves as before.

Known side effect: when a full-screen SDL game is what the detection sees, CloseBigPicture waits its full 6 s and logs "ainda aberto" before the restore goes on.

Verification

  • Unit tests pass locally (355), with a new one for SteamShutdown.IsSteamProcess.
  • The Windows build was left to CI.
  • Not tested on Windows with a real SDL game. The manual check is in docs/TESTING.md (Steam on restore section).

Stacked on #139 (shares the changelog section); merge that one first.

🤖 Generated with Claude Code

lippdev and others added 2 commits October 5, 2026 13:09
The engine rebuilt AppConfig field by field for the session and left out
FpsOverlay and FpsOverlayLayout, so Start always saw the default style.
The copy is now a clone with only the monitor fields swapped.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Big Picture detection accepts any full-screen SDL_app window, so a
running SDL game could get the WM_CLOSE meant for Big Picture.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes I reviewed both commits in this PR: preserving the complete app configuration when resolving session monitor names, and limiting fallback Big Picture close requests to Steam-owned windows.

  • Preserve session settings AppConfig.WithMonitors replaces resolved monitor fields on a copy, retaining other settings such as the saved FPS overlay configuration.
  • Filter close targets The fallback WM_CLOSE is sent only to windows owned by steam or steamwebhelper; broad fullscreen SDL detection remains unchanged for session tracking.
  • Document and test behavior Added regression tests and a manual Windows scenario for fullscreen SDL games, plus changelog entries.

Pullfrog  | View workflow run | Using gpt-6-luna | 𝕏

@lippdev
lippdev merged commit 2170ef1 into main Oct 5, 2026
5 checks passed
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