From b39cc7974e562d31d0dba071788ef49ca3b5a269 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Mon, 22 Mar 2021 14:16:12 +0000 Subject: [PATCH] hotkey: Avoid event_generate() calls during shutdown # Conflicts: # hotkey.py --- hotkey.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hotkey.py b/hotkey.py index 5165e0b9..af2d9533 100644 --- a/hotkey.py +++ b/hotkey.py @@ -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 <>') - self.root.event_generate('<>', when="tail") + if not config.shutting_down: + logger.debug('Sending event <>') + self.root.event_generate('<>', when="tail") else: logger.debug('Passing key on')