From: Jim Evins Date: Fri, 24 Oct 2014 00:45:12 +0000 (-0400) Subject: Added dummy window as parent in warning and critical error handlers. X-Git-Tag: glabels-3_4_0~118 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b66c0076908a706235af21b2c1d3ef04a6ba1f7f;p=glabels Added dummy window as parent in warning and critical error handlers. In gtk 3.14, creating a message dialog without a parent window causes a crash. Unfortunately this causes the original error or warning message from being seen by the user. --- diff --git a/src/critical-error-handler.c b/src/critical-error-handler.c index 0d9fed1d..d7ab99da 100644 --- a/src/critical-error-handler.c +++ b/src/critical-error-handler.c @@ -61,9 +61,11 @@ critical_error_handler (const gchar *log_domain, const gchar *message, gpointer user_data) { + GtkWidget *dummy_window; GtkWidget *dialog; - dialog = gtk_message_dialog_new (NULL, + dummy_window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + dialog = gtk_message_dialog_new (GTK_WINDOW (dummy_window), GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_NONE, diff --git a/src/warning-handler.c b/src/warning-handler.c index 8f5f1b7a..a7cb5f88 100644 --- a/src/warning-handler.c +++ b/src/warning-handler.c @@ -60,9 +60,11 @@ warning_handler (const gchar *log_domain, const gchar *message, gpointer user_data) { + GtkWidget *dummy_window; GtkWidget *dialog; - dialog = gtk_message_dialog_new (NULL, + dummy_window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + dialog = gtk_message_dialog_new (GTK_WINDOW (dummy_window), GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_CLOSE, @@ -73,6 +75,7 @@ warning_handler (const gchar *log_domain, gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (GTK_WIDGET (dialog)); + gtk_widget_destroy (GTK_WIDGET (dummy_window)); }