Set ready state in the game thread based on Steam status (Fixes #658)

This commit is contained in:
Mathieu Comandon 2017-12-30 14:41:41 -08:00
parent aa0b66f42d
commit dfb05cb30e
2 changed files with 12 additions and 2 deletions

View file

@ -446,5 +446,9 @@ class Game(object):
"already using the same Wine prefix.</b>")
def notify_steam_game_changed(self, appmanifest):
logger.debug(appmanifest)
logger.debug(appmanifest.states)
logger.debug("Steam game %s state has changed, new states: %s",
appmanifest.steamid, ', '.join(appmanifest.states))
if 'Fully Installed' in appmanifest.states:
self.game_thread.ready_state = True
elif 'Update Required' in appmanifest.states:
self.game_thread.ready_state = False

View file

@ -41,6 +41,7 @@ class LutrisThread(threading.Thread):
watch=True, cwd=None, include_processes=[], exclude_processes=[], log_buffer=None):
"""Thread init"""
threading.Thread.__init__(self)
self.ready_state = True
self.env = env
self.original_env = {}
self.command = command
@ -286,6 +287,11 @@ class LutrisThread(threading.Thread):
if not self.game_process or not self.is_running:
logger.error('No game process available')
return False
if not self.ready_state:
self.cycles_without_children = 0
return True
processes, num_children, num_watched_children, terminated_children = self.get_processes()
if processes != self.monitored_processes: