[glabels] Added dummy window as parent in warning and critical error handlers.
- From: Jim Evins <jimevins src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glabels] Added dummy window as parent in warning and critical error handlers.
- Date: Fri, 24 Oct 2014 00:52:06 +0000 (UTC)
commit b66c0076908a706235af21b2c1d3ef04a6ba1f7f
Author: Jim Evins <evins snaught com>
Date: Thu Oct 23 20:45:12 2014 -0400
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 0d9fed1..d7ab99d 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 8f5f1b7..a7cb5f8 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));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]