Correctly exit from game when Alt+F4 pressed or 'x' button clicked. See for details: https://savannah.nongnu.org/bugs/?13163 https://savannah.nongnu.org/bugs/?17839 http://www.openbsd.org/cgi-bin/cvsweb/ports/games/crack-attack/patches/patch-src_gtk-gui_gui_main_cxx --- crack-attack-1.1.14/src/gtk-gui/gui_main.cxx 2005-05-01 10:04:12 +0700 +++ crack-attack-1.1.15-cvs-01/src/gtk-gui/gui_main.cxx 2006-06-02 10:38:40 +0700 @@ -50,6 +50,18 @@ int glut_argc; char **glut_argv; +/* + * Call this when the window is unexpectedly destroyed to make sure the + * hidden gui process doesn't hang around in the background. + */ +static void destroy_window(GtkObject *object, gpointer data) { +#ifdef DEVELOPMENT + g_print("\nOh no! We've been unexpectedly destroyed! :(\n"); +#endif + gtk_main_quit(); +} + + /* * Documentation * html tables don't work right in explorer @@ -76,6 +88,8 @@ winCrackAttackSplash = create_winCrackAttackSplash (); gui_data_read(winCrackAttackSplash); gtk_widget_show (winCrackAttackSplash); + g_signal_connect(GTK_OBJECT(winCrackAttackSplash), "destroy", + G_CALLBACK(destroy_window), NULL); gtk_main (); return 0;