mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-15 12:35:55 +08:00
Linux specific: Avoid crashing with DISPLAY variable not set.
This commit is contained in:
parent
8fc620375c
commit
a09b4ff5c8
@ -595,6 +595,18 @@ int CLI::run(int argc, char **argv)
|
|||||||
|
|
||||||
if (start_gui) {
|
if (start_gui) {
|
||||||
#ifdef SLIC3R_GUI
|
#ifdef SLIC3R_GUI
|
||||||
|
#if !defined(_WIN32) && !defined(__APPLE__)
|
||||||
|
// likely some linux / unix system
|
||||||
|
const char *display = boost::nowide::getenv("DISPLAY");
|
||||||
|
const char *wayland_display = boost::nowide::getenv("WAYLAND_DISPLAY");
|
||||||
|
if (! ((display && *display) || (wayland_display && *wayland_display))) {
|
||||||
|
// DISPLAY not set.
|
||||||
|
boost::nowide::cerr << "DISPLAY not set, GUI mode not available." << std::endl << std::endl;
|
||||||
|
this->print_help(false);
|
||||||
|
// Indicate an error.
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
#endif // some linux / unix system
|
||||||
Slic3r::GUI::GUI_InitParams params;
|
Slic3r::GUI::GUI_InitParams params;
|
||||||
params.argc = argc;
|
params.argc = argc;
|
||||||
params.argv = argv;
|
params.argv = argv;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user