Feat: Lower CPU usage when not in focus by stopping 'n slowing down the GUI loop.

This commit is contained in:
SnuffSocket 2024-10-07 02:00:09 +03:00
parent a291b2fc4f
commit e3b2e8ed95

View File

@ -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()