Skip to content

Commit d227c8e

Browse files
committed
- listener process closed, not killed, to avoid SQLite problems;
- sped up wx application startup.
1 parent 9b7b89f commit d227c8e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

inputscope/main.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def toggle(self, input):
7070

7171
def stop(self):
7272
self.running = False
73-
self.listener and self.listener.terminate()
73+
self.listener and self.listenerqueue.put("exit")
7474
self.webui and self.webui.terminate()
7575

7676
def log_resolution(self, size):
@@ -87,7 +87,7 @@ def run(self):
8787
os.path.join(conf.ApplicationPath, x[0])] + list(x[1:])
8888
self.listener = subprocess.Popen(args("listener.py", "--quiet"),
8989
stdin=subprocess.PIPE)
90-
self.webui = subprocess.Popen(args("webui.py"))
90+
self.webui = subprocess.Popen(args("webui.py"))
9191
self.listenerqueue = QueueLine(self.listener.stdin)
9292

9393
if conf.MouseEnabled: self.listenerqueue.put("mouse_start")
@@ -123,8 +123,8 @@ def OnInit(self):
123123
self.frame_console.Bind(wx.EVT_CLOSE, self.OnToggleConsole)
124124

125125
self.model.log_resolution(wx.GetDisplaySize())
126-
self.model.start()
127-
return True
126+
wx.CallAfter(self.model.start)
127+
return True # App.OnInit returns whether processing should continue
128128

129129

130130
def OnOpenMenu(self, event):

0 commit comments

Comments
 (0)