From 1337626b388c66b31e402bc942e9de9d76cc10a0 Mon Sep 17 00:00:00 2001 From: lace <> Date: Wed, 25 Jan 2006 19:31:03 +0000 Subject: [PATCH] Fixed/fortifie libgnomeui compatibility regarding modal dialogs closing. - There was stale dialog crashing on the 2nd click with: libgnomeui-2.10.0-1 --- src/install/acquire/ui-gnome.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/install/acquire/ui-gnome.c b/src/install/acquire/ui-gnome.c index 8f98f98..e6ffc43 100644 --- a/src/install/acquire/ui-gnome.c +++ b/src/install/acquire/ui-gnome.c @@ -36,6 +36,7 @@ #include #include "final.h" #include +#include #include #include @@ -614,11 +615,15 @@ gint reply; (GnomeReplyCallback)on_DruidButtonOK_clicked_dialog_callback, &reply); /* data */ g_signal_connect((gpointer)dialog,"close",G_CALLBACK(gtk_main_quit),NULL); + /* It looks as if eariler libgnomeui had default TRUE + * but since libgnomeui-2.10.0 it is FALSE, weird. + */ + gnome_dialog_set_close(GNOME_DIALOG(dialog),TRUE); /* Never call gtk_main() from other thread than the initial one. * We would have to switch GTK+ context (g_main_context()?). */ gtk_main(); - /* 'dialog' gets destroyed automatically */ + /* 'dialog' gets destroyed automatically due to: gnome_dialog_set_close(,TRUE); */ if (reply==0) /* 0 for 'OK', 1 for 'Cancel', left -1 for dialog close. */ exit(EXIT_SUCCESS); } @@ -745,9 +750,13 @@ GtkWidget *dialog; dialog=gnome_app_message(App,message); gtk_window_set_modal(GTK_WINDOW(dialog),TRUE); + /* It looks as if eariler libgnomeui had default TRUE + * but since libgnomeui-2.10.0 it is FALSE, weird. + */ + gnome_dialog_set_close(GNOME_DIALOG(dialog),TRUE); g_signal_connect((gpointer)dialog,"close",G_CALLBACK(gtk_main_quit),NULL); gtk_main(); - /* 'dialog' gets destroyed automatically */ + /* 'dialog' gets destroyed automatically due to: gnome_dialog_set_close(,TRUE); */ gdk_flush(); gdk_threads_leave(); -- 1.8.3.1