From b66c0076908a706235af21b2c1d3ef04a6ba1f7f Mon Sep 17 00:00:00 2001 From: Jim Evins Date: Thu, 23 Oct 2014 20:45:12 -0400 Subject: [PATCH] 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. --- src/critical-error-handler.c | 4 +++- src/warning-handler.c | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) 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)); } -- 2.39.5