From b68a9ebef5be1eeb79714979863a5177e67c9a08 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Fri, 11 Oct 2019 12:03:23 +0300 Subject: [PATCH] - cleanup SDL fatal error reporting Output error text to terminal if SDL message box cannot be shown Removed wrong "No IWAD found" message --- src/posix/sdl/i_system.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/posix/sdl/i_system.cpp b/src/posix/sdl/i_system.cpp index 721cb99825..40eacf78e1 100644 --- a/src/posix/sdl/i_system.cpp +++ b/src/posix/sdl/i_system.cpp @@ -117,9 +117,8 @@ void Linux_I_FatalError(const char* errortext) if((str=getenv("KDE_FULL_SESSION")) && strcmp(str, "true") == 0) { FString cmd; - cmd << "kdialog --title \"" GAMESIG " "; - cmd << GetVersionString() << ": No IWAD found\" "; - cmd << "--msgbox \"" << errortext << "\""; + cmd << "kdialog --title \"" GAMESIG " " << GetVersionString() + << "\" --msgbox \"" << errortext << "\""; popen(cmd, "r"); } #ifndef NO_GTK @@ -130,10 +129,13 @@ void Linux_I_FatalError(const char* errortext) #endif else { - FString message; - message << GAMESIG " "; - message << GetVersionString() << ": No IWAD found"; - SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, message, errortext, NULL); + FString title; + title << GAMESIG " " << GetVersionString(); + + if (SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, title, errortext, NULL) < 0) + { + printf("\n%s\n", errortext); + } } } #endif