diff --git a/src-python/models/overlay/overlay.py b/src-python/models/overlay/overlay.py index b61213e3..b1ce865c 100644 --- a/src-python/models/overlay/overlay.py +++ b/src-python/models/overlay/overlay.py @@ -71,6 +71,7 @@ class Overlay: self.system = None self.overlay = None self.handle = None + self.init_process = False self.initialized = False self.loop = True self.thread_overlay = None @@ -109,6 +110,7 @@ class Overlay: size ) self.initialized = True + self.init_process = False except Exception as e: printLog("error:Could not initialise OpenVR", e) @@ -243,12 +245,15 @@ class Overlay: time.sleep(sleepTime) def main(self): + while self.checkSteamvrRunning() is False: + time.sleep(10) self.init() if self.initialized is True: self.mainloop() def startOverlay(self): - if self.checkSteamvrRunning() and self.initialized is False: + if self.initialized is False and self.init_process is False: + self.init_process = True self.thread_overlay = Thread(target=self.main) self.thread_overlay.daemon = True self.thread_overlay.start() diff --git a/src-python/webui_controller.py b/src-python/webui_controller.py index b73a5e45..3c83b626 100644 --- a/src-python/webui_controller.py +++ b/src-python/webui_controller.py @@ -1354,8 +1354,6 @@ class Controller: def setEnableTranscriptionSend(self, *args, **kwargs) -> dict: self.startThreadingTranscriptionSendMessage() config.ENABLE_TRANSCRIPTION_SEND = True - if config.OVERLAY_LARGE_LOG is True: - model.startOverlay() return {"status":200, "result":config.ENABLE_TRANSCRIPTION_SEND} def setDisableTranscriptionSend(self, *args, **kwargs) -> dict: @@ -1365,8 +1363,6 @@ class Controller: def setEnableTranscriptionReceive(self, *args, **kwargs) -> dict: self.startThreadingTranscriptionReceiveMessage() - if (config.OVERLAY_SMALL_LOG is True or config.OVERLAY_LARGE_LOG is True): - model.startOverlay() config.ENABLE_TRANSCRIPTION_RECEIVE = True return {"status":200, "result":config.ENABLE_TRANSCRIPTION_RECEIVE} @@ -1763,6 +1759,10 @@ class Controller: if config.AUTO_SPEAKER_SELECT is True: self.setEnableAutoSpeakerSelect() + printLog("Init Overlay") + if (config.OVERLAY_SMALL_LOG is True or config.OVERLAY_LARGE_LOG is True): + model.startOverlay() + self.updateConfigSettings() printLog("End Initialization")