From dc6b2f2d2186d45f115e0de72d39f2152bd7f8bd Mon Sep 17 00:00:00 2001 From: JezerM Date: Sun, 26 Dec 2021 21:54:14 -0600 Subject: [PATCH] Fixed context_menu on non-debug mode --- web-greeter/__main__.py | 1 + web-greeter/browser/browser.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/web-greeter/__main__.py b/web-greeter/__main__.py index c064e39..c8bb07d 100644 --- a/web-greeter/__main__.py +++ b/web-greeter/__main__.py @@ -100,4 +100,5 @@ if __name__ == '__main__': globals.greeter = Browser() greeter = globals.greeter + greeter.show() greeter.run() diff --git a/web-greeter/browser/browser.py b/web-greeter/browser/browser.py index 875fb1f..289dbf2 100644 --- a/web-greeter/browser/browser.py +++ b/web-greeter/browser/browser.py @@ -239,6 +239,8 @@ class Browser(Application): if web_greeter_config["config"]["greeter"]["debug_mode"]: self._initialize_devtools() + else: + self.view.setContextMenuPolicy(Qt.PreventContextMenu) if web_greeter_config["config"]["greeter"]["secure_mode"]: if (hasattr(QWebEngineProfile, "setUrlRequestInterceptor")): @@ -255,8 +257,6 @@ class Browser(Application): logger.debug("Browser Window created") - self.show() - def load(self): self.greeter = Greeter() self.greeter_config = Config()