mirror of
https://github.com/EyeTrackVR/EyeTrackVR.git
synced 2025-11-04 14:39:42 +08:00
Feat: Lower CPU usage when not in focus by stopping 'n slowing down the GUI loop.
This commit is contained in:
parent
a291b2fc4f
commit
e3b2e8ed95
@ -328,6 +328,14 @@ def main():
|
||||
os._exit(0) # I do not like this, but for now this fixes app hang on close
|
||||
return
|
||||
|
||||
# When focus is lost stop 'n slow down the loop here.
|
||||
try:
|
||||
if not window.TKroot.focus_get():
|
||||
time.sleep(0.2)
|
||||
continue
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
if values[key_manager.RIGHT_EYE_RADIO_NAME] and config.eye_display_id != EyeId.RIGHT:
|
||||
config.settings.gui_disable_gui = False
|
||||
eyes[0].start()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user