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.
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,
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,
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (GTK_WIDGET (dialog));
+ gtk_widget_destroy (GTK_WIDGET (dummy_window));
}