Index: shell/ev-window.c
===================================================================
RCS file: /cvs/gnome/evince/shell/ev-window.c,v
retrieving revision 1.136
diff -u -p -r1.136 ev-window.c
--- shell/ev-window.c	12 May 2005 08:32:35 -0000	1.136
+++ shell/ev-window.c	16 May 2005 14:52:38 -0000
@@ -125,6 +125,8 @@ struct _EvWindowPrivate {
 	/* recent file stuff */
 	EggRecentModel *recent_model;
 	EggRecentViewGtk *recent_view;
+	
+	GnomeVFSMonitorHandle *monitor;
 };
 
 static const GtkTargetEntry ev_drop_types[] = {
@@ -168,7 +170,11 @@ static void     ev_window_run_presentati
 static void     ev_window_stop_presentation             (EvWindow         *window);
 static void     ev_window_cmd_view_presentation         (GtkAction        *action,
 							 EvWindow         *window);
-
+static void     ev_window_document_monitor_cb		(GnomeVFSMonitorHandle *handle,
+						         const gchar *monitor_uri,
+							 const gchar *info_uri,
+							 GnomeVFSMonitorEventType event_type,
+    			    				 gpointer user_data);
 
 G_DEFINE_TYPE (EvWindow, ev_window, GTK_TYPE_WINDOW)
 
@@ -730,6 +736,12 @@ start_loading_document (EvWindow   *ev_w
 		ev_window_setup_document (ev_window);
 		
 		ev_window_add_recent (ev_window, uri);
+			
+		gnome_vfs_monitor_add (&ev_window->priv->monitor,
+				       uri,
+				       GNOME_VFS_MONITOR_FILE,
+				       ev_window_document_monitor_cb,
+				       ev_window);
 
 		return TRUE;
 	}
@@ -1787,6 +1799,22 @@ ev_window_cmd_view_reload (GtkAction *ac
 }
 
 static void
+ev_window_document_monitor_cb (GnomeVFSMonitorHandle *handle,
+		             const gchar *monitor_uri,
+			     const gchar *info_uri,
+			     GnomeVFSMonitorEventType event_type,
+			     gpointer user_data)
+{
+	EvWindow *window;
+	
+	window = EV_WINDOW (user_data);
+
+	if (event_type == GNOME_VFS_MONITOR_EVENT_CHANGED) {
+		ev_window_cmd_view_reload (NULL, window);
+	}
+}
+
+static void
 ev_window_cmd_help_contents (GtkAction *action, EvWindow *ev_window)
 {
 	GError *error = NULL;
@@ -2261,6 +2289,11 @@ ev_window_dispose (GObject *object)
 	if (priv->page_cache) {
 		g_signal_handlers_disconnect_by_func (priv->page_cache, page_changed_cb, window);
 		priv->page_cache = NULL;
+	}
+	
+	if (priv->monitor) {
+		gnome_vfs_monitor_cancel (priv->monitor);
+		priv->monitor = NULL;
 	}
 
 	if (priv->document) {
