mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-25 22:57:22 +00:00
qt: Set DISPLAY env var when not present
Fixes web browser opening (Help > Open Mods Page, Help > Open Quickstart Guide)
This commit is contained in:
parent
fe9588f4a0
commit
cd7abba1a9
1 changed files with 9 additions and 0 deletions
|
@ -59,6 +59,7 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QShortcut>
|
#include <QShortcut>
|
||||||
#include <QStatusBar>
|
#include <QStatusBar>
|
||||||
|
#include <QString>
|
||||||
#include <QSysInfo>
|
#include <QSysInfo>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QtConcurrent/QtConcurrent>
|
#include <QtConcurrent/QtConcurrent>
|
||||||
|
@ -2999,6 +3000,14 @@ int main(int argc, char* argv[]) {
|
||||||
chdir(bin_path.c_str());
|
chdir(bin_path.c_str());
|
||||||
#endif
|
#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
|
// Enables the core to make the qt created contexts current on std::threads
|
||||||
QCoreApplication::setAttribute(Qt::AA_DontCheckOpenGLContextThreadAffinity);
|
QCoreApplication::setAttribute(Qt::AA_DontCheckOpenGLContextThreadAffinity);
|
||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
|
|
Loading…
Reference in a new issue