From 8261e6f256601b58110e74dbc802f34f776df215 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 5 Oct 2018 23:49:46 +0200 Subject: [PATCH] SDL/Qt: At least quit properly when switching backends --- Qt/QtMain.cpp | 3 +++ SDL/SDLMain.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/Qt/QtMain.cpp b/Qt/QtMain.cpp index ada30411ad61..080067913aea 100644 --- a/Qt/QtMain.cpp +++ b/Qt/QtMain.cpp @@ -107,6 +107,9 @@ bool System_GetPropertyBool(SystemProperty prop) { void System_SendMessage(const char *command, const char *parameter) { if (!strcmp(command, "finish")) { qApp->exit(0); + } else if (!strcmp(command, "graphics_restart")) { + // Should find a way to properly restart the app. + qApp->exit(0); } } diff --git a/SDL/SDLMain.cpp b/SDL/SDLMain.cpp index 6dd6d2242b7c..6b74f17b01ee 100644 --- a/SDL/SDLMain.cpp +++ b/SDL/SDLMain.cpp @@ -116,6 +116,9 @@ void System_SendMessage(const char *command, const char *parameter) { } else if (!strcmp(command, "finish")) { // Do a clean exit g_QuitRequested = true; + } else if (!strcmp(command, "graphics_restart")) { + // Not sure how we best do this, but do a clean exit, better than being stuck in a bad state. + g_QuitRequested = true; } }