PATCH: closing gnomeICU main window doesn't kill the program any more



  I just spent a few minutes convincing GnomeICU that if it has a panel applet,
it really doesn't need to quit when the main window closes.  Here's the patch.

  Daniel
-- 
  You will soon forget this.
? gnomeicu/src/gnomeicu
Index: gnomeicu/src/gnomeicu.c
===================================================================
RCS file: /cvs/gnome/gnomeicu/src/gnomeicu.c,v
retrieving revision 1.8
diff -u -r1.8 gnomeicu.c
--- gnomeicu/src/gnomeicu.c	1999/03/25 23:47:13	1.8
+++ gnomeicu/src/gnomeicu.c	1999/03/28 06:56:11
@@ -184,6 +184,12 @@
 int hide_ch_window( GtkWidget *widget, GdkEvent *event, GtkWidget *window );
 void Check_Endian( void );
 
+gint hide_dont_kill( GtkWidget *widget )
+{
+	gtk_widget_hide(widget);
+	return TRUE;
+}
+
 void ready_set( void )
 {
 	char *sts = NULL;
@@ -1207,13 +1213,18 @@
 
 	gtk_widget_realize( app );
 	gnome_app_create_menus( GNOME_APP( app ), mainmenu );
-
-	/* Changed from "delete_event" to "destroy" because it is right :) [PEL]
-	 * Now it doesn't segfault when closed by the WM */
 
-	/* EKP 3.10.99 - changed icq_quit_object to icq_quit */
-	gtk_signal_connect( GTK_OBJECT( app ), "destroy",
-	                           GTK_SIGNAL_FUNC( icq_quit ), (gpointer)&sal );
+	if( applet_toggle==FALSE ) {	
+		/* Changed from "delete_event" to "destroy" because it is right :) [PEL]
+	 	* Now it doesn't segfault when closed by the WM */
+
+		/* EKP 3.10.99 - changed icq_quit_object to icq_quit */
+		gtk_signal_connect( GTK_OBJECT( app ), "destroy",
+	                           	GTK_SIGNAL_FUNC( icq_quit ), (gpointer)&sal );
+	} else {
+		gtk_signal_connect( GTK_OBJECT( app ), "delete_event",
+					GTK_SIGNAL_FUNC( hide_dont_kill ), 0 );
+	}
 
 	gtk_widget_set_usize( app, WindowWidth, WindowHeight );
 


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