Skip to content

[Fix] possible fix to Heroic does not stay minimized #5611#5646

Open
MateoGonzalezLourido wants to merge 1 commit into
Heroic-Games-Launcher:mainfrom
MateoGonzalezLourido:fix/minimize-on-launch
Open

[Fix] possible fix to Heroic does not stay minimized #5611#5646
MateoGonzalezLourido wants to merge 1 commit into
Heroic-Games-Launcher:mainfrom
MateoGonzalezLourido:fix/minimize-on-launch

Conversation

@MateoGonzalezLourido

Copy link
Copy Markdown

<--- Put the description here --->

What

Fixes the "minimize on launch" feature not maintaining the hidden state on
subsequent game launches without reopening Heroic.

related to #5611

Root cause

launchEventCallback called mainWindow.hide() unconditionally whenever
minimizeOnLaunch && !noTrayIcon, with no check for whether the window was
already hidden.

After the first game exits, the window stays hidden (there is no show() call
in the exit path). On the second launch — e.g. from the tray icon's
"Recent Games" context menu, without explicitly reopening Heroic — hide() was
called on an already-hidden window ( this causes the
window to briefly flash with a frozen/blank background before the game starts and leaves the window state inconsistent for subsequent launches.).

protocol.ts already guards against this with an isVisible() check
(lines 128-134); launchEventCallback was missing the same guard.

Changes

src/backend/launcher.ts

  • Added mainWindow?.isVisible() guard before calling hide(), consistent
    with the pattern already used in protocol.ts. This prevents calling hide()
    on an already-hidden window, which caused the blank-window flash and
    inconsistent state on Linux.

  • Fixed powerDisplayId never being reset to null after
    powerSaveBlocker.stop(). Because of this, starting from the third game
    launch the guard if (!powerDisplayId) evaluated to false (non-zero integer
    is truthy), silently skipping the display-sleep blocker for all subsequent
    sessions.


I can't test it.It works just as well on my PC as the original.

Use the following Checklist if you have changed something on the Backend or Frontend:

  • Tested the feature and it's working on a current and clean install.
  • Tested the main App features and they are still working on a current and clean install. (Login, Install, Play, Uninstall, Move games, etc.)
  • Created / Updated Tests (If necessary)
  • Created / Updated documentation (If necessary)

@MateoGonzalezLourido MateoGonzalezLourido changed the title possible fix to Heroic does not stay minimized #5611 [Fix] possible fix to Heroic does not stay minimized #5611 Jun 11, 2026
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