Don't try to display the GUI when running in textmode (#387)

* Don't try to display the GUI when running in textmode

* Updated textmode fix to always run the GUI under Windows
This commit is contained in:
uzlonewolf 2017-08-27 03:09:39 -07:00 committed by pwpiwi
commit c6c0449105

View file

@ -274,8 +274,22 @@ int main(int argc, char* argv[]) {
pthread_mutex_init(&print_lock, NULL);
#ifdef HAVE_GUI
#ifdef _WIN32
InitGraphics(argc, argv, script_cmds_file, usb_present);
MainGraphics();
#else
char* display = getenv("DISPLAY");
if (display && strlen(display) > 1)
{
InitGraphics(argc, argv, script_cmds_file, usb_present);
MainGraphics();
}
else
{
main_loop(script_cmds_file, usb_present);
}
#endif
#else
main_loop(script_cmds_file, usb_present);
#endif