Files
lhns--steam-frame-nix/modules/steam-close-button/unpatch.js
T
Pierre Kisters 36fcb207bd steam-close-button: keep Steam hidden after X until shown explicitly
Closing Steam with X now marks it hidden (state steamHidden). Before,
bar-only ended as soon as any window became active, so closing a docked
window afterwards let stock SteamVR fall back to Steam.

While hidden, the stock fallbacks go to the most recently active other
docked window with a tab, else bar-only:
- autoSwitchOverlayIfNeeded with no active frame;
- the dashboard mailbox's dashboard_overlay_destroyed handler (stock:
  switchToHomeOverlay -> Steam);
- show/switch requests for Steam with reason "theater frame destroyed"
  (key removed) or "SetDockLocation" (echo of X docking Steam: dropped).
Steam becoming the active frame (tab click, Steam menu pick,
SwitchToDashboardOverlay) ends hidden.

The hidden state replaces the rule that swallowed the first
ShowOverlay(main) from Steam after each dashboard open in bar-only (Steam
doesn't send one there; its only effect was eating a real Steam menu
pick). Version 7; state of versions 5/6 is taken over (bar-only implies
hidden), their fields are left for a rollback. Signatures: mailbox and
dashboard handler anchors, the ShowOverlay ones dropped.
2026-09-28 02:46:31 +02:00

12 lines
500 B
JavaScript

// Reverts steam-close-button/patch.js (the X disappears). Never switches
// frames and keeps window.__sfuiSteamCloseState (Steam hidden, bar-only), so
// a re-injection continues; restores the Dashboard methods and mailbox
// handlers it wrapped. If removed while bar-only, the dashboard stays without
// an active frame until the next tab click or open. Safe when not patched.
(() => {
const s = window.__sfuiSteamClose;
if (!s) return 'not patched';
s.teardown();
return 'unpatched';
})()