Merge pull request #905 from kiwix/appimage-hack

Add a small hack to fix QWebEngine using appimage.
This commit is contained in:
Kelson 2022-11-23 17:04:43 +01:00 committed by GitHub
commit 0d0aa054c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,6 +10,15 @@
#endif
int main(int argc, char *argv[])
{
// Small hack to make QtWebEngine works with AppImage.
// See https://github.com/probonopd/linuxdeployqt/issues/554
if (::getenv("APPIMAGE") != nullptr) {
qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--disable-gpu --no-sandbox");
QApplication::setAttribute(Qt::AA_UseOpenGLES);
}
// End of hack ^^^
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
QWebEngineUrlScheme scheme("zim");