Index: gsearchtool.h
===================================================================
RCS file: /cvs/gnome/gnome-utils/gsearchtool/gsearchtool.h,v
retrieving revision 1.51
diff -u -p -r1.51 gsearchtool.h
--- gsearchtool.h	2 Dec 2005 22:10:07 -0000	1.51
+++ gsearchtool.h	20 Dec 2005 06:10:55 -0000
@@ -46,6 +46,8 @@ extern "C" {
 #define GNOME_SEARCH_TOOL_ICON "gnome-searchtool"
 #define MINIMUM_WINDOW_WIDTH   420
 #define MINIMUM_WINDOW_HEIGHT  310
+#define DEFAULT_WINDOW_WIDTH   554
+#define DEFAULT_WINDOW_HEIGHT  350
 #define WINDOW_HEIGHT_STEP      35
 #define NUM_VISIBLE_COLUMNS      5
 
@@ -84,6 +86,8 @@ struct _GSearchWindow {
 	GtkWidget             * window;
 	GtkUIManager          * window_ui_manager;
 	GdkGeometry             window_geometry;
+	gint                    window_width;
+	gint                    window_height;
 	gboolean                is_window_accessible;
 	
 	GtkWidget             * name_contains_entry;
Index: gsearchtool-support.h
===================================================================
RCS file: /cvs/gnome/gnome-utils/gsearchtool/gsearchtool-support.h,v
retrieving revision 1.31
diff -u -p -r1.31 gsearchtool-support.h
--- gsearchtool-support.h	5 Nov 2005 19:15:19 -0000	1.31
+++ gsearchtool-support.h	20 Dec 2005 06:10:55 -0000
@@ -46,6 +46,9 @@ gsearchtool_gconf_set_boolean (const gch
 gint 
 gsearchtool_gconf_get_int (const gchar * key);
 
+void
+gsearchtool_gconf_set_int (const gchar * key,
+                           const gint value);
 char *
 gsearchtool_gconf_get_string (const gchar * key);
 
@@ -121,6 +124,11 @@ gsearchtool_get_columns_order (GtkTreeVi
 
 void
 gsearchtool_set_columns_order (GtkTreeView * treeview);
+
+void
+gsearchtool_get_stored_window_geometry (gint * width,
+                                        gint * height);
+
 #ifdef __cplusplus
 }
 #endif
Index: gsearchtool.c
===================================================================
RCS file: /cvs/gnome/gnome-utils/gsearchtool/gsearchtool.c,v
retrieving revision 1.296
diff -u -p -r1.296 gsearchtool.c
--- gsearchtool.c	2 Dec 2005 22:10:07 -0000	1.296
+++ gsearchtool.c	20 Dec 2005 06:10:59 -0000
@@ -2721,6 +2721,15 @@ gsearchtool_ui_manager (GSearchWindow * 
 	                                                                          "/PopupMenu/SaveResultsAs");
 }
 
+static void
+gsearch_window_size_allocate (GtkWidget     *widget,
+			      GtkAllocation *allocation,
+			      GSearchWindow *gsearch)
+{
+	gsearch->window_width = allocation->width;
+	gsearch->window_height = allocation->height;
+}
+
 static GtkWidget *
 gsearch_app_create (GSearchWindow * gsearch)
 {
@@ -2736,6 +2745,9 @@ gsearch_app_create (GSearchWindow * gsea
 	GdkPixbuf * pixbuf;
 	
 	gsearch->window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+	g_signal_connect (G_OBJECT (gsearch->window), "size-allocate",
+			  G_CALLBACK (gsearch_window_size_allocate),
+			  gsearch);
 	gsearch->command_details = g_new0 (GSearchCommandDetails, 1);
 	gsearch->window_geometry.min_height = MINIMUM_WINDOW_HEIGHT;
 	gsearch->window_geometry.min_width  = MINIMUM_WINDOW_WIDTH;
@@ -2743,6 +2755,11 @@ gsearch_app_create (GSearchWindow * gsea
 	gtk_window_set_position (GTK_WINDOW (gsearch->window), GTK_WIN_POS_CENTER);	
 	gtk_window_set_geometry_hints (GTK_WINDOW (gsearch->window), GTK_WIDGET (gsearch->window),
 				       &gsearch->window_geometry, GDK_HINT_MIN_SIZE);
+	gsearchtool_get_stored_window_geometry (&gsearch->window_width,
+	                                        &gsearch->window_height);
+	gtk_window_set_default_size (GTK_WINDOW (gsearch->window),
+	                             gsearch->window_width,
+	                             gsearch->window_height);
 	
 	container = gtk_vbox_new (FALSE, 6);
 	gtk_container_add (GTK_CONTAINER (gsearch->window), container);	
@@ -2869,7 +2886,7 @@ gsearch_app_create (GSearchWindow * gsea
 	button = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
 	GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
 	g_signal_connect (G_OBJECT (button), "clicked",
-			  G_CALLBACK (click_close_cb), (gpointer) gsearch->command_details);
+			  G_CALLBACK (click_close_cb), (gpointer) gsearch);
   	if (gsearch->is_window_accessible) {
 		add_atk_namedesc (GTK_WIDGET (button), NULL, _("Click to close \"Search for Files\"."));
 	}
@@ -3012,7 +3029,7 @@ main (int argc, 
 
 	g_signal_connect (G_OBJECT (gsearch->window), "delete_event",
 	                            G_CALLBACK (quit_cb),
-	                            (gpointer) gsearch->command_details);
+	                            (gpointer) gsearch);
 	g_signal_connect (G_OBJECT (gsearch->window), "key_press_event",
 	                            G_CALLBACK (key_press_cb), 
 	                            (gpointer) gsearch);
@@ -3023,7 +3040,7 @@ main (int argc, 
 		                  (gpointer) gsearch);
 		g_signal_connect (client, "die",
 		                  G_CALLBACK (die_cb),
-		                  (gpointer) gsearch->command_details);
+		                  (gpointer) gsearch);
 	}
 
 	gtk_widget_show (gsearch->window);
Index: gsearchtool-callbacks.c
===================================================================
RCS file: /cvs/gnome/gnome-utils/gsearchtool/gsearchtool-callbacks.c,v
retrieving revision 1.97
diff -u -p -r1.97 gsearchtool-callbacks.c
--- gsearchtool-callbacks.c	3 Dec 2005 07:01:03 -0000	1.97
+++ gsearchtool-callbacks.c	20 Dec 2005 06:11:00 -0000
@@ -55,8 +55,10 @@ extern pid_t getpgid (pid_t);
 gboolean row_selected_by_button_press_event;
 
 static void
-quit_application (GSearchCommandDetails * command_details)
+quit_application (GSearchWindow * gsearch)
 {
+	GSearchCommandDetails * command_details = gsearch->command_details;
+	
 	if (command_details->command_status == RUNNING) {
 #ifdef HAVE_GETPGID
 		pid_t pgid;
@@ -76,6 +78,19 @@ quit_application (GSearchCommandDetails 
 #endif
 		wait (NULL);
 	}
+	
+	if (gsearch->window_width < MINIMUM_WINDOW_WIDTH) {
+		gsearch->window_width = MINIMUM_WINDOW_WIDTH;
+	}
+	if (gsearch->window_height < MINIMUM_WINDOW_HEIGHT) {
+		gsearch->window_height = MINIMUM_WINDOW_HEIGHT;
+	}
+		
+	gsearchtool_gconf_set_int ("/apps/gnome-search-tool/default_window_width",
+	                           gsearch->window_width);
+	gsearchtool_gconf_set_int ("/apps/gnome-search-tool/default_window_height",
+		                   gsearch->window_height);
+
 	gtk_main_quit ();
 }
 
@@ -83,7 +98,7 @@ void
 die_cb (GnomeClient * client,
 	gpointer data)
 {
-	quit_application ((GSearchCommandDetails *) data);
+	quit_application ((GSearchWindow *) data);
 }
 
 void
@@ -91,14 +106,14 @@ quit_cb (GtkWidget * widget,
          GdkEvent * event,
 	 gpointer data)
 {
-	quit_application ((GSearchCommandDetails *) data);
+	quit_application ((GSearchWindow *) data);
 }
 
 void
 click_close_cb (GtkWidget * widget,
                 gpointer data)
 {
-	quit_application ((GSearchCommandDetails *) data);
+	quit_application ((GSearchWindow *) data);
 }
 
 void
Index: gsearchtool-support.c
===================================================================
RCS file: /cvs/gnome/gnome-utils/gsearchtool/gsearchtool-support.c,v
retrieving revision 1.86
diff -u -p -r1.86 gsearchtool-support.c
--- gsearchtool-support.c	5 Nov 2005 19:15:19 -0000	1.86
+++ gsearchtool-support.c	20 Dec 2005 06:11:01 -0000
@@ -182,6 +182,23 @@ gsearchtool_gconf_get_int (const gchar *
 	return result;
 }
 
+void
+gsearchtool_gconf_set_int (const gchar * key,
+                           const gint    value)
+{
+	GConfClient * client;
+	GError * error = NULL;
+	
+	g_return_if_fail (key != NULL);
+	
+	client = gsearchtool_gconf_client_get_global ();
+	g_return_if_fail (client != NULL);
+	
+	gconf_client_set_int (client, key, value, &error);
+	
+	gsearchtool_gconf_handle_error (&error);
+}
+
 gboolean 
 gsearchtool_gconf_get_boolean (const gchar * key)
 {
@@ -1475,4 +1492,34 @@ gsearchtool_set_columns_order (GtkTreeVi
 		}
 	}
 	g_slist_free (order);
+}
+
+void
+gsearchtool_get_stored_window_geometry (gint *width,
+                                        gint *height)
+{
+	gint saved_width;
+	gint saved_height;
+
+	saved_width = gsearchtool_gconf_get_int ("/apps/gnome-search-tool/default_window_width");
+	saved_height = gsearchtool_gconf_get_int ("/apps/gnome-search-tool/default_window_height");
+
+	if (saved_width <= 0) {
+		saved_width = DEFAULT_WINDOW_WIDTH;
+	}
+
+	if (saved_height <= 0) {
+		saved_height = DEFAULT_WINDOW_HEIGHT;
+	}
+
+	saved_width = MAX (saved_width, MINIMUM_WINDOW_WIDTH);
+	saved_height = MAX (saved_height, MINIMUM_WINDOW_HEIGHT);
+
+	if (width != NULL) {
+		*width = saved_width;
+	}
+	
+	if (height != NULL) {
+		*height = saved_height;
+	}
 }
Index: gnome-search-tool.schemas.in
===================================================================
RCS file: /cvs/gnome/gnome-utils/gsearchtool/gnome-search-tool.schemas.in,v
retrieving revision 1.11
diff -u -p -r1.11 gnome-search-tool.schemas.in
--- gnome-search-tool.schemas.in	5 Nov 2005 19:15:19 -0000	1.11
+++ gnome-search-tool.schemas.in	20 Dec 2005 06:11:01 -0000
@@ -331,5 +331,35 @@ To change the gconftool target use the -
         </long>
       </locale>
     </schema>
+    <schema>
+      <applyto>/apps/gnome-search-tool/default_window_width</applyto>
+      <key>/schemas/apps/gnome-search-tool/default_window_width</key>
+      <owner>gnome-search-tool</owner>
+      <type>int</type>
+      <default>-1</default>
+      <locale name="C">
+        <short>Default Window Width</short>
+	<long>
+	  This key defines the window width, and it's used to remember the
+	  size of the search tool between sessions.  Setting it to -1 will
+	  make the search tool use the default size.
+	</long>
+      </locale>
+    </schema>
+    <schema>
+      <applyto>/apps/gnome-search-tool/default_window_height</applyto>
+      <key>/schemas/apps/gnome-search-tool/default_window_height</key>
+      <owner>gnome-search-tool</owner>
+      <type>int</type>
+      <default>-1</default>
+      <locale name="C">
+        <short>Default Window Height</short>
+	<long>
+	  This key defines the window height, and it's used to remember the
+	  size of the search tool between sessions.  Setting it to -1 will
+	  make the search tool use the default size.
+	</long>
+      </locale>
+    </schema>
   </schemalist>
 </gconfschemafile>
