From f0adaa66dce1fe21ea4139318ac072a866ec752f Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Tue, 22 Nov 2022 16:08:22 +0100 Subject: [PATCH] Add a small hack to fix QWebEngine using appimage. Fix #810 --- src/main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 81ac15f..213b20b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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");