Skip to content

Commit

Permalink
umu_run: access the root window from the display
Browse files Browse the repository at this point in the history
  • Loading branch information
R1kaB3rN committed Jul 18, 2024
1 parent 365146d commit 06e0468
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions umu/umu_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,9 @@ def get_window_client_ids(d: display.Display) -> list[str]:

if event.type == X.CreateNotify:
log.debug("Found new child windows")
return [child.id for child in root.query_tree().children]
return [
child.id for child in d.screen().root.query_tree().children
]
except Exception as e:
log.exception(e)

Expand Down Expand Up @@ -489,13 +491,11 @@ def set_steam_game_property( # noqa: D103

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

# Intern the atom for GAMESCOPECTRL_BASELAYER_APPID
atom = d.get_atom("GAMESCOPECTRL_BASELAYER_APPID")

# Get the property value
prop = root.get_full_property(atom, Xatom.CARDINAL)
prop = d.screen().root.get_full_property(atom, Xatom.CARDINAL)

if prop:
# Extract and return the value
Expand Down Expand Up @@ -533,7 +533,7 @@ def set_gamescope_baselayer_order( # noqa
atom = d.get_atom("GAMESCOPECTRL_BASELAYER_APPID")

# Set the property value
root_primary.change_property(atom, Xatom.CARDINAL, 32, rearranged)
d.screen().root.change_property(atom, Xatom.CARDINAL, 32, rearranged)
log.debug(
"Successfully set GAMESCOPECTRL_BASELAYER_APPID property: %s",
", ".join(map(str, rearranged)),
Expand Down

0 comments on commit 06e0468

Please sign in to comment.