Repository navigation
Conversation
An app's type (X11 or Wayland) is only discovered once it has a window, and the is_running() checks that move an app to STOPPED only run for a known type. An app that exits before creating any window, such as a launcher script that fails at once, therefore stays in the running list forever: the loading screen never goes away and EXIT lifecycle hooks never run. While the type is still unknown, mark the app stopped as soon as is_running() fails; no grace period is needed, as the tracked process (the reaper) only exits once all of the app's processes have.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
RunningApp.update()only learns an app's type (X11 or Wayland) from its first window, and only the X11 and Wayland paths run theis_running()checks that move an app toSTOPPED. While the type is stillUNKNOWN, nothing checks whether the process is still alive.So an app that exits before it creates any window stays in the running list forever. A launcher script that fails at once is one example, as is a game binary that crashes on start. The loading screen never goes away, and
EXITlifecycle hooks never run. The player has to open the running-app menu and pick Exit by hand.Changes
While the app's type is still unknown,
update()marks itSTOPPED(and emitsapp_killed) as soon asis_running()fails. It doesn't wait out the X11/Wayland grace of four failed checks: the tracked PID is the reaper, which only exits once every process of the app has. That makes the loading screen clear within onecheck_running()tick (~1 s).Apps that do create a window are unchanged: once their type is detected, the existing X11/Wayland paths handle them as before.
Testing
Tested on an AYANEO Pocket ACE (aarch64): a library item whose launch command exits with an error in ~20 ms, before any window. Before: the loading screen stayed up indefinitely and the item's
EXIThook never ran. After: the app is removed from the running list 0.6 s after launch, theEXIThook runs, and the menu comes back. Normal game launches and exits are unaffected.