summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Ani2021-03-07 15:56:22 +0000
committerGravatar Ani2021-03-07 15:56:22 +0000
commitcd7abba1a9e713e9557f6dfcae1b609eaa91995b (patch)
tree01b971a3c18537aed24f36c50bdbc374329ee2e7 /src
parentMerge pull request #5323 from Morph1984/enforce-c4101 (diff)
downloadyuzu-cd7abba1a9e713e9557f6dfcae1b609eaa91995b.tar.gz
yuzu-cd7abba1a9e713e9557f6dfcae1b609eaa91995b.tar.xz
yuzu-cd7abba1a9e713e9557f6dfcae1b609eaa91995b.zip
qt: Set DISPLAY env var when not present
Fixes web browser opening (Help > Open Mods Page, Help > Open Quickstart Guide)
Diffstat (limited to '')
-rw-r--r--src/yuzu/main.cpp9
1 files changed, 9 insertions, 0 deletions
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
59#include <QPushButton> 59#include <QPushButton>
60#include <QShortcut> 60#include <QShortcut>
61#include <QStatusBar> 61#include <QStatusBar>
62#include <QString>
62#include <QSysInfo> 63#include <QSysInfo>
63#include <QUrl> 64#include <QUrl>
64#include <QtConcurrent/QtConcurrent> 65#include <QtConcurrent/QtConcurrent>
@@ -2999,6 +3000,14 @@ int main(int argc, char* argv[]) {
2999 chdir(bin_path.c_str()); 3000 chdir(bin_path.c_str());
3000#endif 3001#endif
3001 3002
3003#ifdef __linux__
3004 // Set the DISPLAY variable in order to open web browsers
3005 // TODO (lat9nq): Find a better solution for AppImages to start external applications
3006 if (QString::fromLocal8Bit(qgetenv("DISPLAY")).isEmpty()) {
3007 qputenv("DISPLAY", ":0");
3008 }
3009#endif
3010
3002 // Enables the core to make the qt created contexts current on std::threads 3011 // Enables the core to make the qt created contexts current on std::threads
3003 QCoreApplication::setAttribute(Qt::AA_DontCheckOpenGLContextThreadAffinity); 3012 QCoreApplication::setAttribute(Qt::AA_DontCheckOpenGLContextThreadAffinity);
3004 QApplication app(argc, argv); 3013 QApplication app(argc, argv);