Index: libegg/ChangeLog
===================================================================
RCS file: /export/cvs/gnome-2.0/libegg/ChangeLog,v
retrieving revision 1.267
diff -p -u -5 -r1.267 ChangeLog
--- libegg/ChangeLog	2004/04/16 19:42:21	1.267
+++ libegg/ChangeLog	2004/04/22 10:52:23
@@ -1,5 +1,20 @@
+2004-04-22  Leena Gunda  <leena.gunda@wipro.com>
+
+	* libegg/recent-files/egg-recent-model.c:
+	(egg_recent_model_monitor): If the FAM support is unavailable,
+	we do a poll of the .recently-used file ourselves
+	(egg_recent_model_poll_timeout): Poll the file after every
+	3 seconds.
+	(egg_recent_model_init): initialize poll_timeout to zero.
+	(egg_recent_model_finalize): remove the poll timeout. 
+	* libegg/recent-files/egg-recent-view-gtk.c:
+	(egg_recent_view_gtk_set_menu): attach a callback to unref the 
+	view when the menu is destroyed.
+	(egg_recent_view_gtk_unref_view): callback to unref the view.
+	Fixes bug#140153. 
+	
 2004-04-16  Marco Pesenti Gritti  <marco@gnome.org>
 
 	* libegg/toolbareditor/Makefile.am:
 	* libegg/toolbareditor/egg-editable-toolbar.c:
 	(get_toolbar_position), (get_dock_nth), (get_toolbar_nth),

Index: libegg/libegg/recent-files/egg-recent-model.c
===================================================================
RCS file: /export/cvs/gnome-2.0/libegg/libegg/recent-files/egg-recent-model.c,v
retrieving revision 1.26
diff -p -u -5 -r1.26 egg-recent-model.c
--- libegg/libegg/recent-files/egg-recent-model.c	2004/01/31 16:05:43	1.26
+++ libegg/libegg/recent-files/egg-recent-model.c	2004/04/22 10:52:23
@@ -69,10 +69,13 @@ struct _EggRecentModelPrivate {
 
 	guint limit_change_notify_id;
 	guint expiration_change_notify_id;
 
 	guint changed_timeout;
+	guint poll_timeout;
+	GnomeVFSFileInfo *info;
+	time_t mtime;
 };
 
 /* signals */
 enum {
 	CHANGED,
@@ -671,24 +674,63 @@ egg_recent_model_monitor_cb (GnomeVFSMon
 			(GSourceFunc)egg_recent_model_changed_timeout,
 			model);
 	}
 }
 
+static gboolean
+egg_recent_model_poll_timeout (gpointer user_data)
+{
+	GnomeVFSResult result;
+	EggRecentModel *model;
+
+	model = EGG_RECENT_MODEL (user_data);
+
+	result = gnome_vfs_get_file_info (model->priv->path,
+					  model->priv->info,
+					  GNOME_VFS_FILE_INFO_DEFAULT);
+
+	if (result == GNOME_VFS_OK && model->priv->info->mtime && 
+	    model->priv->mtime != model->priv->info->mtime) {
+		
+		model->priv->mtime = model->priv->info->mtime;
+		
+		if (model->priv->changed_timeout > 0) 
+			g_source_remove (model->priv->changed_timeout);
+
+		model->priv->changed_timeout = g_timeout_add (EGG_RECENT_MODEL_TIMEOUT_LENGTH,
+							      (GSourceFunc)egg_recent_model_changed_timeout,
+							      model);
+
+	}
+	return TRUE;
+}
+
 static void
 egg_recent_model_monitor (EggRecentModel *model, gboolean should_monitor)
 {
 	if (should_monitor && model->priv->monitor == NULL) {
-
-		gnome_vfs_monitor_add (&model->priv->monitor,
-					     model->priv->path,
-					     GNOME_VFS_MONITOR_FILE,
-					     egg_recent_model_monitor_cb,
-					     model);
+		
+		GnomeVFSResult result;
+		result = gnome_vfs_monitor_add (&model->priv->monitor,
+				  		model->priv->path,
+				     		GNOME_VFS_MONITOR_FILE,
+						egg_recent_model_monitor_cb,
+						model);
 
 		/* if the above fails, don't worry about it.
 		 * local notifications will still happen
 		 */
+                
+		if (result == GNOME_VFS_ERROR_NOT_SUPPORTED) {
+			
+			if (model->priv->poll_timeout > 0) 
+				g_source_remove (model->priv->poll_timeout);
+			
+			model->priv->poll_timeout = g_timeout_add (EGG_RECENT_MODEL_POLL_TIME  * 1000,
+								   egg_recent_model_poll_timeout,
+								   model);
+                }
 
 	} else if (!should_monitor && model->priv->monitor != NULL) {
 		gnome_vfs_monitor_cancel (model->priv->monitor);
 		model->priv->monitor = NULL;
 	}
@@ -941,10 +983,17 @@ egg_recent_model_finalize (GObject *obje
 	if (model->priv->expiration_change_notify_id)
 		gconf_client_notify_remove (model->priv->client,
 					    model->priv->expiration_change_notify_id);
 	model->priv->expiration_change_notify_id = 0;
 
+	if (model->priv->poll_timeout > 0) 
+		g_source_remove (model->priv->poll_timeout);
+	model->priv->poll_timeout = 0;
+
+	gnome_vfs_file_info_unref (model->priv->info);
+	model->priv->info = NULL;
+
 	g_object_unref (model->priv->client);
 	model->priv->client = NULL;
 
 
 	g_free (model->priv->path);
@@ -1186,10 +1235,14 @@ egg_recent_model_init (EggRecentModel * 
 					g_str_hash, g_str_equal,
 					(GDestroyNotify) g_free,
 					(GDestroyNotify) gnome_vfs_monitor_cancel);
 
 	model->priv->monitor = NULL;
+	model->priv->poll_timeout = 0;
+	model->priv->info = gnome_vfs_file_info_new ();
+	model->priv->mtime = 0;
+
 	egg_recent_model_monitor (model, TRUE);
 }
 
 
 /**

Index: libegg/libegg/recent-files/egg-recent-view-gtk.c
===================================================================
RCS file: /export/cvs/gnome-2.0/libegg/libegg/recent-files/egg-recent-view-gtk.c,v
retrieving revision 1.20
diff -p -u -5 -r1.20 egg-recent-view-gtk.c
--- libegg/libegg/recent-files/egg-recent-view-gtk.c	2003/01/21 11:06:16	1.20
+++ libegg/libegg/recent-files/egg-recent-view-gtk.c	2004/04/22 10:52:23
@@ -664,10 +664,17 @@ egg_recent_view_gtk_set_tooltip_func (Eg
 	
 	if (view->model)
 		egg_recent_model_changed (view->model);
 }
 
+static void 
+egg_recent_view_gtk_view_unref (GtkWidget *menu,
+                                EggRecentViewGtk *view)
+{
+	g_object_unref (G_OBJECT (view));
+}
+
 /**
  * egg_recent_view_gtk_set_menu:
  * @view: A EggRecentViewGtk object.
  * @menu: The GtkMenuShell to put the menu items in.
  *
@@ -686,10 +693,14 @@ egg_recent_view_gtk_set_menu (EggRecentV
 	if (view->menu != NULL)
 		g_object_unref (view->menu);
 	
 	view->menu = menu;
 	g_object_ref (view->menu);
+
+	g_signal_connect (view->menu, "destroy",
+			  G_CALLBACK (egg_recent_view_gtk_view_unref),
+			  view);
 }
 
 /**
  * egg_recent_view_gtk_set_start_menu_item:
  * @view: A EggRecentViewGtk object.

Index: gnome-panel/gnome-panel/ChangeLog
===================================================================
RCS file: /export/cvs/gnome-2.0/gnome-panel/gnome-panel/ChangeLog,v
retrieving revision 1.2367
diff -p -u -5 -r1.2367 ChangeLog
--- gnome-panel/gnome-panel/ChangeLog	2004/04/21 09:23:17	1.2367
+++ gnome-panel/gnome-panel/ChangeLog	2004/04/22 10:52:28
@@ -1,5 +1,11 @@
+2004-04-22  Leena Gunda  <leena.gunda@wipro.com>
+
+	* panel-recent.c (panel_recent_append_documents_menu):
+	do not unref the view when menu is destroyed. Now it 
+	gets done in libegg itself
+
 2004-04-21  Kaushal Kumar  <kaushal.kumar@wipro.com>
 
 	* menu.c (show_panel_help): Set the help link id for
 	menu.
 
Index: gnome-panel/gnome-panel/panel-recent.c
===================================================================
RCS file: /export/cvs/gnome-2.0/gnome-panel/gnome-panel/panel-recent.c,v
retrieving revision 1.14
diff -p -u -5 -r1.14 panel-recent.c
--- gnome-panel/gnome-panel/panel-recent.c	2004/02/04 13:05:46	1.14
+++ gnome-panel/gnome-panel/panel-recent.c	2004/04/22 10:52:28
@@ -192,9 +192,6 @@ panel_recent_append_documents_menu (GtkW
 			  menu);
 	egg_recent_view_gtk_show_numbers (view, FALSE);
 	egg_recent_view_set_model (EGG_RECENT_VIEW (view), model);
 	egg_recent_view_gtk_set_icon_size (view, panel_menu_icon_get_size ());
 	g_object_unref (G_OBJECT (model));
-
-	g_object_set_data_full (G_OBJECT (menu), "recent-view",
-				view, g_object_unref);
 }
