Skip to content

Commit

Permalink
umu_run: compute the set difference to only set new windows
Browse files Browse the repository at this point in the history
  • Loading branch information
R1kaB3rN committed Jul 20, 2024
1 parent b446e11 commit 2562db5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions umu/umu_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,18 +594,19 @@ def monitor_windows(
window_client_list: list[str],
) -> None:
"""Monitor for new windows and assign them Steam's layer ID."""
window_client_set: set[str] = set(window_client_list)
steam_assigned_layer_id: int = gamescope_baselayer_sequence[-1]

log.debug("Monitoring windows")

while True:
# Check if the window sequence has changed
current_window_list = get_window_client_ids(d_secondary)
current_window_list: set[str] = set(get_window_client_ids(d_secondary))

if not current_window_list:
continue

if current_window_list != window_client_list:
if window_client_set.difference(current_window_list):
log.debug("New windows detected")
set_steam_game_property(
d_secondary, current_window_list, steam_assigned_layer_id
Expand Down

0 comments on commit 2562db5

Please sign in to comment.