diff options
Diffstat (limited to 'src/leap/bitmask')
-rw-r--r-- | src/leap/bitmask/gui/app2.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/leap/bitmask/gui/app2.py b/src/leap/bitmask/gui/app2.py index 13f369c4..f037a000 100644 --- a/src/leap/bitmask/gui/app2.py +++ b/src/leap/bitmask/gui/app2.py @@ -31,17 +31,21 @@ import webbrowser from functools import partial from multiprocessing import Process +import webview +import psutil + from leap.bitmask.core.launcher import run_bitmaskd, pid from leap.common.config import get_path_prefix #from leap.bitmask.gui import app_rc -import webview DEBUG = os.environ.get("DEBUG", False) BITMASK_URI = 'http://localhost:7070/' PIXELATED_URI = 'http://localhost:9090/' +PROCNAME = 'bitmask-app' + qApp = None bitmaskd = None browser = None @@ -114,7 +118,13 @@ def launch_gui(): def start_app(): from leap.bitmask.util import STANDALONE - os.environ['QT_AUTO_SCREEN_SCALE_FACTOR'] = '1' + + mypid = os.getpid() + + # Kill a previously-running process + for proc in psutil.process_iter(): + if proc.name() == PROCNAME and proc.pid != mypid: + proc.kill() # Allow the frozen binary in the bundle double as the cli entrypoint # Why have only a user interface when you can have two? |