From 47bf2085f6f13c46254f9df53c7ecedc8de0c5fe Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 17 Jul 2022 14:58:42 +0530 Subject: [PATCH] Allow using webengine after QApplication construction when using ensure_app as well --- src/calibre/gui2/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/calibre/gui2/__init__.py b/src/calibre/gui2/__init__.py index 0e03be953c..11252d81e4 100644 --- a/src/calibre/gui2/__init__.py +++ b/src/calibre/gui2/__init__.py @@ -1555,6 +1555,7 @@ def ensure_app(headless=True): os.environ['QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM'] = '1' if headless and iswindows: QApplication.setAttribute(Qt.ApplicationAttribute.AA_UseSoftwareOpenGL, True) + QApplication.setAttribute(Qt.ApplicationAttribute.AA_ShareOpenGLContexts) _store_app = QApplication(args) if headless and has_headless: _store_app.headless = True