Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle potential ValueError when rearranging base layer #250

Merged
merged 2 commits into from
Oct 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions umu/umu_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,9 +467,16 @@ def rearrange_gamescope_baselayer_order(
if not steam_layer_id:
return None

rearranged.remove(steam_layer_id)
try:
rearranged.remove(steam_layer_id)
except ValueError as e:
# Case when the layer ID isn't in GAMESCOPECTRL_BASELAYER_APPID
# One case this can occur is if the client overrides Steam's env vars
# that we get the layer ID from
log.exception(e)
return None

# Steam's window should last, while assigned layer 2nd to last
# Steam's window should be last, while assigned layer 2nd to last
rearranged = [*rearranged[:-1], steam_layer_id, STEAM_WINDOW_ID]
log.debug("Rearranging base layer sequence")
log.debug("'%s' -> '%s'", sequence, rearranged)
Expand Down