]> git.sur5r.net Git - glabels/commitdiff
Added dummy window as parent in warning and critical error handlers.
authorJim Evins <evins@snaught.com>
Fri, 24 Oct 2014 00:45:12 +0000 (20:45 -0400)
committerJim Evins <evins@snaught.com>
Fri, 24 Oct 2014 02:32:24 +0000 (22:32 -0400)
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
src/warning-handler.c

index 0d9fed1d44d3ca94140139cd4d9d4603ac119f3f..d7ab99dab2afe32787a4e05c54faf09b14034624 100644 (file)
@@ -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,
index 8f5f1b7af419483c0592d8e3c75000e128caed8e..a7cb5f88a6bc53b86d6a3b73e01d24bb500d38d1 100644 (file)
@@ -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));
 }