Qt/linux: set DISPLAY variable if undefined

This commit is contained in:
Megamouse 2020-02-10 11:06:45 +01:00 committed by Ivan
parent 98f91457bf
commit 30d176ac5e
2 changed files with 9 additions and 1 deletions

View file

@ -120,6 +120,14 @@ QCoreApplication* createApplication(int& argc, char* argv[])
if (find_arg(arg_headless, argc, argv))
return new headless_application(argc, argv);
#ifdef __linux__
// set the DISPLAY variable in order to open web browsers
if (qEnvironmentVariable("DISPLAY", "").isEmpty())
{
qputenv("DISPLAY", ":0");
}
#endif
bool use_high_dpi = true;
const auto i_hdpi = find_arg(arg_high_dpi, argc, argv);