From d7ee715254386a40219c3e605542add8f517a482 Mon Sep 17 00:00:00 2001 From: collecting Date: Tue, 23 Sep 2025 10:43:30 +0000 Subject: [PATCH] Environment Variables (SSL and Wayland) --- src/citron/main.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/citron/main.cpp b/src/citron/main.cpp index a8411ab43..fcabffac4 100644 --- a/src/citron/main.cpp +++ b/src/citron/main.cpp @@ -5456,6 +5456,19 @@ static void SetHighDPIAttributes() { } int main(int argc, char* argv[]) { + // Set environment variables for AppImage compatibility + // This must be done before the QApplication is created. + const bool is_appimage = !qgetenv("APPIMAGE").isEmpty(); + if (is_appimage) { + // Fixes Wayland crash with NVIDIA drivers by disabling explicit sync. + qputenv("QT_WAYLAND_DISABLE_EXPLICIT_SYNC", "1"); + + // Tell the bundled OpenSSL where to find the bundled certificates. + const QDir app_dir(QCoreApplication::applicationDirPath()); + const QString certs_path = app_dir.filePath("../etc/ssl/certs"); + qputenv("SSL_CERT_DIR", certs_path.toUtf8()); + } + std::unique_ptr config = std::make_unique(); UISettings::RestoreWindowState(config); bool has_broken_vulkan = false;