feat: no gui mode fix window close bug

This commit is contained in:
Prohurtz 2024-07-22 18:14:53 -05:00
parent bbd7c9d4d5
commit 2938c49b63

View File

@ -302,6 +302,8 @@ def main():
eventg, valuesg = windowg.read()
if eventg == sg.WINDOW_CLOSED:
config.settings.gui_disable_gui = False
config.save()
break
elif eventg == 'Enable GUI':
config.settings.gui_disable_gui = False
@ -309,15 +311,12 @@ def main():
print('GUI Enabled')
break
# Close the window
windowg.close()
print('close')
# First off, check for any events from the GUI
window = create_window(config, settings, eyes)
print('new window')
while True:
event, values = window.read(timeout=1) # this higher timeout saves some cpu usage