summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-03-12 21:10:28 +0100
committerGitHub <noreply@github.com>2021-03-12 21:10:28 +0100
commit5dae45b958908fedb4fb55def3d5ee5ad51f8266 (patch)
treeda0aae3f9aa857a794797cc43b93ab4c31b159ee
parentMerge pull request #6040 from german77/toggleKeyboard (diff)
parentqt: Set DISPLAY env var when not present (diff)
downloadyuzu-5dae45b958908fedb4fb55def3d5ee5ad51f8266.tar
yuzu-5dae45b958908fedb4fb55def3d5ee5ad51f8266.tar.gz
yuzu-5dae45b958908fedb4fb55def3d5ee5ad51f8266.tar.bz2
yuzu-5dae45b958908fedb4fb55def3d5ee5ad51f8266.tar.lz
yuzu-5dae45b958908fedb4fb55def3d5ee5ad51f8266.tar.xz
yuzu-5dae45b958908fedb4fb55def3d5ee5ad51f8266.tar.zst
yuzu-5dae45b958908fedb4fb55def3d5ee5ad51f8266.zip
-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 56d892a31..24bfa4d34 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -60,6 +60,7 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual
#include <QPushButton>
#include <QShortcut>
#include <QStatusBar>
+#include <QString>
#include <QSysInfo>
#include <QUrl>
#include <QtConcurrent/QtConcurrent>
@@ -3061,6 +3062,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);