Skip to content

Commit

Permalink
umu_run: don't handle display exceptions for now
Browse files Browse the repository at this point in the history
  • Loading branch information
R1kaB3rN committed Jul 13, 2024
1 parent 37aeca8 commit 627a167
Showing 1 changed file with 9 additions and 33 deletions.
42 changes: 9 additions & 33 deletions umu/umu_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,17 +442,11 @@ def build_command(

def get_window_client_ids() -> list[str]:
"""Get the list of client windows."""
d: display.Display
# FIXME: For the general case, don't assume gamescope will create a
# server associated to :1
d: display.Display = display.Display(":1")
root: Window

try:
# FIXME: For the general case, don't assume gamescope will create a
# server associated to :1
d = display.Display(":1")
except ConnectionRefusedError as e:
log.exception(e)
return []

try:
root = d.screen().root

Expand Down Expand Up @@ -485,15 +479,9 @@ def get_window_client_ids() -> list[str]:
def set_steam_game_property( # noqa: D103
window_ids: list[str], steam_assigned_layer_id: int
) -> None:
d: display.Display
d: display.Display = display.Display(":1")
window: Window

try:
d = display.Display(":1")
except ConnectionRefusedError as e:
log.exception(e)
return

root = d.screen().root
log.debug("Root: %s", root)

Expand Down Expand Up @@ -526,15 +514,9 @@ def set_steam_game_property( # noqa: D103


def get_gamescope_baselayer_order() -> list[int] | None: # noqa: D103
d: display.Display
d: display.Display = display.Display(":0")
root: Window

try:
d = display.Display(":0")
except ConnectionRefusedError as e:
log.exception(e)
return None

try:
root = d.screen().root

Expand Down Expand Up @@ -574,18 +556,12 @@ def rearrange_gamescope_baselayer_order( # noqa


def set_gamescope_baselayer_order(rearranged: list[int]) -> None: # noqa
d: display.Display
# FIXME: :0 is invalid when under tty sessions > 1. Instead of
# connecting to :0, we need to use the current DISPLAY. While
# this is OK for the Steam Deck, it is not OK for the general case
d: display.Display = display.Display(":0")
root: Window

try:
# FIXME: :0 is invalid when under tty sessions > 1. Instead of
# connecting to :0, we need to use the current DISPLAY. While
# this is OK for the Steam Deck, it is not OK for the general case
d = display.Display(":0")
except ConnectionRefusedError as e:
log.exception(e)
return

try:
root = d.screen().root

Expand Down

0 comments on commit 627a167

Please sign in to comment.