Index: libnautilus-private/nautilus-program-choosing.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-program-choosing.c,v
retrieving revision 1.76
diff -p -u -r1.76 nautilus-program-choosing.c
--- libnautilus-private/nautilus-program-choosing.c	25 Nov 2004 14:13:37 -0000	1.76
+++ libnautilus-private/nautilus-program-choosing.c	4 Feb 2005 23:30:40 -0000
@@ -366,14 +366,11 @@ add_startup_timeout (GdkScreen         *
  * this should not be needed.
  */
 static Time
-slowly_and_stupidly_obtain_timestamp (SnDisplay *display)
+slowly_and_stupidly_obtain_timestamp (Display *xdisplay)
 {
 	Window xwindow;
-	Display *xdisplay;
 	XEvent event;
 	
-	xdisplay = sn_display_get_x_display (display);
-	
 	{
 		XSetWindowAttributes attrs;
 		Atom atom_name;
@@ -511,7 +508,7 @@ void nautilus_launch_show_file (Nautilus
 			char **old_envp;
 			Time timestamp;
 
-			timestamp = slowly_and_stupidly_obtain_timestamp (sn_display);
+			timestamp = slowly_and_stupidly_obtain_timestamp (GDK_WINDOW_XDISPLAY (GTK_WIDGET (parent_window)->window));
 
 			binary_name = gnome_vfs_mime_application_get_binary_name (application);
 		
@@ -742,7 +739,7 @@ nautilus_launch_application (GnomeVFSMim
 			char **old_envp;
 			Time timestamp;
 
-			timestamp = slowly_and_stupidly_obtain_timestamp (sn_display);
+			timestamp = slowly_and_stupidly_obtain_timestamp (GDK_WINDOW_XDISPLAY (GTK_WIDGET (parent_window)->window));
 			
 			binary_name = gnome_vfs_mime_application_get_binary_name (application);
 		
@@ -858,6 +855,7 @@ nautilus_launch_desktop_file (GdkScreen 
 	const GList *p;
 	int total, count;
 	char **envp;
+	Time timestamp;
 
 	/* strip the leading command specifier */
 	if (eel_str_has_prefix (desktop_file_uri, NAUTILUS_DESKTOP_COMMAND_SPECIFIER)) {
@@ -947,6 +945,9 @@ nautilus_launch_desktop_file (GdkScreen 
 	}
 
 	error = NULL;
+
+	timestamp = slowly_and_stupidly_obtain_timestamp (GDK_WINDOW_XDISPLAY (GTK_WIDGET (parent_window)->window));
+	gnome_desktop_item_set_launch_time (ditem, timestamp);
 	gnome_desktop_item_launch_with_env (ditem, (GList *) parameter_uris,
 					    flags, envp,
 					    &error);
