hotkey: Avoid event_generate() calls during shutdown

# Conflicts:
#	hotkey.py
This commit is contained in:
Athanasius committed 2021-04-01 14:45:48 +01:00
1 parent 608a336bb3
commit b39cc7974e
1 file changed
+4 -3
+4 -3
View File
@@ -128,7 +128,7 @@ if platform == 'darwin':
self.acquire_state = HotkeyMgr.ACQUIRE_INACTIVE
def _acquire_poll(self):
if config.shutting_down:
if config.shutting_down():
return
# No way of signalling to Tkinter from within the monkey-patched event handler that doesn't
@@ -350,8 +350,9 @@ elif platform == 'win32':
config.get_int('hotkey_always')
or WindowTitle(GetForegroundWindow()).startswith('Elite - Dangerous')
):
logger.debug('Sending event <<Invoke>>')
self.root.event_generate('<<Invoke>>', when="tail")
if not config.shutting_down:
logger.debug('Sending event <<Invoke>>')
self.root.event_generate('<<Invoke>>', when="tail")
else:
logger.debug('Passing key on')