feat(Launch): add app lifecycle implementation and better handling of steam #470
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change adds a new "Application Lifecycle Hooks" feature that can allow library plugins to hook into different parts of the application launch process, allowing plugins to execute code before or after an application launches. This can be useful for things like pre-compiling shaders, starting a service, downloading dependencies, etc.
These lifecycle hooks also have a mechanism to emit text or progress that can be displayed when a game is launching:

Plugin developers can add app lifecycle hooks by implementing the
get_app_lifecycle_hooks()function in their library plugin that returns a list ofAppLifecycleHookobjects that will be executed before or after an app launches.Additionally, this change includes updates to the
LaunchManagerto use the modern way (gamescope v3.16.14+) of focusing apps, which now uses an array of focused apps instead of a single value and also includes some extra fixes such as:create,spawn, andstartmethods toRunningAppto allow delaying the start of an application.RunningAppfor detecting when Steam apps close.OGUI_IDenvironment variable to identify all processes that belong to a particularRunningApp.