Repository navigation
Add a setting to delay or skip hiding Pegasus after launching a game - #1191
PaleThunder18 wants to merge 2 commits into
Conversation
|
The Android failure doesn't come from this change. Both Android jobs compile the C++ fine, then fail at Major version 69 is Java 25. The |
|
The code looks good, but the CI had some issues. Could you rebase to the current master branch? |
Pegasus tears down its frontend as soon as the launched program has started. Many programs take a while to show their window, so the desktop is exposed in between, which breaks the console-like experience on desktop setups (see mmatyas#648). Add a "Hide Pegasus after launching a game" option in the Gaming section of the settings menu, stored as general.hide-delay-after-launch in settings.txt: - 0 (Immediately, the default): the current behavior, unchanged. - N > 0 (the menu offers 2, 5 and 10 seconds): keep the frontend visible for N seconds, then tear it down. If the program exits before that, the frontend is simply brought back to the front without a rebuild. - Negative (Never): keep the frontend alive while the program runs. On Android, and on Qt platforms that only allow one program on the screen (eglfs, linuxfb, vkkhrdisplay, minimal*), Pegasus always hides immediately regardless of this setting. ProcessLauncher now reports processFinished itself when no teardown is waiting on the program, and onTeardownComplete no longer assumes the program is still running. This also avoids dereferencing a null process if a program exits before a teardown has completed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
88ce5f6 to
2bef49e
Compare
The patch no longer applied after the changes to onTeardownComplete(). Keep the waiting flag around the start-and-wait so the finish is only reported once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Rebased onto current master. The buster-pi4 failure was from this change: |
Closes #648.
What
Adds "Hide Pegasus after launching a game" to the Gaming section of the settings menu, saved as
general.hide-delay-after-launchinsettings.txt:02,5,10(any positive number works in the file)-1(any negative number)As discussed in #648, the delay doesn't apply where only one program can draw to the screen. On Android, and when Qt runs on
eglfs,linuxfb,vkkhrdisplayorminimal*, Pegasus always hides immediately and logs why.Why
Many programs take a few seconds to show their window, and on desktop setups the desktop is exposed during that time. It is a long-standing complaint in #648 and breaks the console-like experience, especially on HTPCs and streamed setups (Moonlight/Sunshine).
How
Backend::onProcessLaunched()either tears down immediately (the stock path), starts a single-shot timer, or keeps the frontend.Backend::onProcessFinished()stops the timer, then either rebuilds the frontend or calls the newFrontendLayer::bringToFront().ProcessLaunchernow emitsprocessFinisheditself when no teardown is waiting on the program.onTeardownComplete()no longer assumes the program is still running. This also avoids dereferencing a null process if a program exits before a teardown completes.scan-on-launch(AppSettings → Settings property → SettingsFile → SettingsMain.qml).lastrun.log.Default behavior is unchanged: with the default value, the code path is the same as before, apart from the
ProcessLauncherbookkeeping above.Testing
Ubuntu 26.04, Qt 5.15.18, GNOME on Wayland, launching RetroDECK (Flatpak) with a DualSense controller, streamed over Moonlight:
settings.txt.ctest: all tests pass excepttest_KeyEditor,test_Blurhashandtest_SortFilter, which fail on this machine only because theQtTestQML module isn't installed (unrelated).Not tested on real hardware: Android, and Linux without a compositor (eglfs/KMS). The forced-immediate path there is a short platform check, reviewed but not run.
Notes
QT_TR_NOOP/qsTr, so they can go through the usual translation update.MultivalueBoxdisplaysmodel.nameas-is (the same as the existing language and theme lists, which show native names). The selected value on the settings row is translated.🤖 Generated with Claude Code