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