From cd7abba1a9e713e9557f6dfcae1b609eaa91995b Mon Sep 17 00:00:00 2001 From: Ani Date: Sun, 7 Mar 2021 15:56:22 +0000 Subject: qt: Set DISPLAY env var when not present Fixes web browser opening (Help > Open Mods Page, Help > Open Quickstart Guide) --- src/yuzu/main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 2c10160c8..e5d27969c 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -59,6 +59,7 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual #include #include #include +#include #include #include #include @@ -2999,6 +3000,14 @@ int main(int argc, char* argv[]) { chdir(bin_path.c_str()); #endif +#ifdef __linux__ + // Set the DISPLAY variable in order to open web browsers + // TODO (lat9nq): Find a better solution for AppImages to start external applications + if (QString::fromLocal8Bit(qgetenv("DISPLAY")).isEmpty()) { + qputenv("DISPLAY", ":0"); + } +#endif + // Enables the core to make the qt created contexts current on std::threads QCoreApplication::setAttribute(Qt::AA_DontCheckOpenGLContextThreadAffinity); QApplication app(argc, argv); -- cgit v1.2.3