1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-14 08:17:13 +03:00

Unregister hotkey on app exit on Windows.

Hopefully fixes issues #68 and #69.
This commit is contained in:
Jonathan Harris 2015-12-30 18:53:38 +00:00
parent 47d757ffbb
commit b9257cead3
2 changed files with 2 additions and 0 deletions

View File

@ -481,6 +481,7 @@ class AppWindow:
self.w.clipboard_append(self.station['text'] == self.STATION_UNDOCKED and self.system['text'] or '%s,%s' % (self.system['text'], self.station['text']))
def onexit(self, event=None):
hotkeymgr.unregister()
flightlog.close()
if platform!='darwin' or self.w.winfo_rooty()>0: # http://core.tcl.tk/tk/tktview/c84f660833546b1b84e7
config.set('geometry', '+{1}+{2}'.format(*self.w.geometry().split('+')))

View File

@ -278,6 +278,7 @@ elif platform == 'win32':
def unregister(self):
if self.thread:
PostThreadMessage(self.thread.ident, WM_QUIT, 0, 0)
self.thread.join() # Wait for it to unregister hotkey and quit
self.thread = None
def worker(self, keycode, modifiers):