[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: 6 days till Bug Horizon

On Wed, Feb 23, 2000 at 10:54:11PM -0500, Daniel Burrows was heard to say:
> On Wed, Feb 23, 2000 at 11:52:46PM +0100, Richard Braakman was heard to say:
> > Package: gnome-chess (debian/main).
> > Maintainer: Vincent Renardias <vincent@debian.org>
> >   56036 gnome-chess: want exit via window manager close button
>   Ok, spinning forever when you get a destroy event is nasty, but is it really
> release-critical?
>   OTOH, it doesn't look like it should be too hard to patch.. (crossing fingers,
> toes, etc) .. just catch the destroy and kill children/background threads (the
> code to do this should already be there, to handle File/Quit)  I could even do
> it if I had time (I don't even have time to write this email :) )

  Ok, I have time now :)  I've attached a shot at this to this email..it may
or may not work; unfortunately, I'm on a text terminal at the moment and
can't test it.  It compiles, though!  The main possible gotchas that I can
see are that the gnome_app framework (which I haven't used much) might need
me to insert the callback in a different way, and that the return of the
delete funtion might be wrong (you have to return either 1 or 0 and I can
never remember which; if I got it wrong, the window won't close at all but
the engines will still be stopped..)


X is the second worst window system ever invented. 
Everything else is tied for first.
Only in gnome-chess-0.2.4.prev: gnome-chess.spec
diff -ru gnome-chess-0.2.4.prev/src/main.c gnome-chess-0.2.4/src/main.c
--- gnome-chess-0.2.4.prev/src/main.c	Tue Oct 26 17:11:15 1999
+++ gnome-chess-0.2.4/src/main.c	Fri Feb 25 11:37:02 2000
@@ -58,6 +58,20 @@
 	{ NULL, '\0', 0, NULL, 0 }
+int main_delete(GtkWidget *widget, gpointer data);
+int main_delete(GtkWidget *widget, gpointer data) {
+  /* Copied from menus.cc -- meant to keep the children from spinning ad
+   * infinitum if the main windor is closed.
+   * A quick hack to fix an RCB bug that shouldn't be, I don't know enough
+   * about gnome_app to know what really should be done..
+   *   -- DNB
+   */
+  engine_destroy_all();
+  gtk_main_quit ();
+  return 1;
 int main(int argc,char *argv[]) {
 	GtkWidget *box;
@@ -83,6 +97,11 @@
 	/* Ugly hack to get rid of a temporary zvt problem */
+	gtk_signal_connect( GTK_OBJECT (app),
+			    "delete_event",
+			    GTK_SIGNAL_FUNC(main_delete),
+			    NULL);
 	first_chess_programm = NULL;
 	/* Check to see if we got command line args for an engine */

Reply to: