Skip to content

Commit

Permalink
dont use gameid for hhd
Browse files Browse the repository at this point in the history
  • Loading branch information
antheas committed Jul 6, 2024
1 parent 1ca13fa commit cb399dc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/hhd/plugins/overlay/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def loop_manage_overlay(

if hhd:
logger.info(f"UI window found in gamescope, starting handler.")
prepare_hhd(disp, hhd)
prepare_hhd(disp, hhd, steam)
if steam:
register_changes(disp, steam)

Expand Down
13 changes: 10 additions & 3 deletions src/hhd/plugins/overlay/x11.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
X11_DIR = b"/tmp/.X11-unix/"
HHD_ID = 5335


class CachedValues(NamedTuple):
overlay: bool
focus: bool
Expand Down Expand Up @@ -280,8 +281,12 @@ def print_debug(display: display.Display, args: list[str] = []):
)


def prepare_hhd(display, hhd):
hhd.change_property(display.get_atom("STEAM_GAME"), Xatom.CARDINAL, 32, [HHD_ID])
def prepare_hhd(display, hhd, steam=None):
if not steam:
# If hhd appears a game steam will have issues with per-game profiles
hhd.change_property(
display.get_atom("STEAM_GAME"), Xatom.CARDINAL, 32, [HHD_ID]
)
hhd.change_property(display.get_atom("STEAM_NOTIFICATION"), Xatom.CARDINAL, 32, [0])
hhd.change_property(display.get_atom("STEAM_BIGPICTURE"), Xatom.CARDINAL, 32, [1])
hhd.change_property(display.get_atom("GAMESCOPE_NO_FOCUS"), Xatom.CARDINAL, 32, [1])
Expand Down Expand Up @@ -429,7 +434,9 @@ def make_hhd_not_focusable(display):
# Hide HHD
if write_focus:
new_focus = [v for v in focusable.value if v != HHD_ID]
logger.info(f"Hiding Handheld Daemon from gamescope. Setting focusable apps to: {new_focus}")
logger.info(
f"Hiding Handheld Daemon from gamescope. Setting focusable apps to: {new_focus}"
)
display.screen().root.change_property(
stat_focused, Xatom.CARDINAL, 32, new_focus
)
Expand Down

0 comments on commit cb399dc

Please sign in to comment.