|
@@ -1,3 +1,4 @@
|
|
|
+import _thread
|
|
|
import multiprocessing
|
|
|
import os
|
|
|
import signal
|
|
@@ -24,10 +25,8 @@ def activate(url: str, title: str, width: int, height: int, fullscreen: bool) ->
|
|
|
shutdown = multiprocessing.Event()
|
|
|
|
|
|
def check_shutdown() -> None:
|
|
|
- while True:
|
|
|
- if shutdown.is_set():
|
|
|
- os.kill(os.getpgid(os.getpid()), signal.SIGTERM)
|
|
|
- time.sleep(0.1)
|
|
|
+ if shutdown.wait() and shutdown.is_set():
|
|
|
+ _thread.interrupt_main()
|
|
|
|
|
|
args = url, title, width, height, fullscreen, shutdown
|
|
|
multiprocessing.Process(target=open_window, args=args, daemon=False).start()
|