From 74c624bc7b97c45e7a2a7d7870fce526766dea28 Mon Sep 17 00:00:00 2001 From: cxl Date: Fri, 20 Feb 2015 13:52:59 +0000 Subject: [PATCH] CtrlCore: Gtk: Now using xmessage for Panic to avoid crashing with KDE git-svn-id: svn://ultimatepp.org/upp/trunk@8188 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/CtrlCore/GtkApp.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/uppsrc/CtrlCore/GtkApp.cpp b/uppsrc/CtrlCore/GtkApp.cpp index 68bef4a52..704e3431e 100644 --- a/uppsrc/CtrlCore/GtkApp.cpp +++ b/uppsrc/CtrlCore/GtkApp.cpp @@ -26,11 +26,15 @@ void _DBG_Ungrab(void) void Ctrl::PanicMsgBox(const char *title, const char *text) { LLOG("PanicMsgBox " << title << ": " << text); - _DBG_Ungrab(); - GtkWidget *dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, - GTK_BUTTONS_CLOSE, "%s: %s", title, text); - gtk_dialog_run(GTK_DIALOG (dialog)); - gtk_widget_destroy(dialog); + if(system("which xmessage") == 0) + system(String().Cat() << "xmessage -center \"" << title << "\n" << text << "\""); + else { + _DBG_Ungrab(); + GtkWidget *dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, + GTK_BUTTONS_CLOSE, "%s: %s", title, text); + gtk_dialog_run(GTK_DIALOG (dialog)); + gtk_widget_destroy(dialog); + } __BREAK__; }