Skip to content

Commit

Permalink
fix: handle potential ValueError when rearranging base layer (Open-Wi…
Browse files Browse the repository at this point in the history
…ne-Components#250)

* umu_run: handle ValueError when rearranging base layer

* umu_run: fix comment
  • Loading branch information
R1kaB3rN authored Oct 22, 2024
1 parent 2af98f4 commit 6d434b1
Showing 1 changed file with 9 additions and 2 deletions.
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

0 comments on commit 6d434b1

Please sign in to comment.