Index: src/yelp-base.c
===================================================================
RCS file: /cvs/gnome/yelp/src/yelp-base.c,v
retrieving revision 1.52
diff -u -p -r1.52 yelp-base.c
--- src/yelp-base.c	16 May 2005 21:09:48 -0000	1.52
+++ src/yelp-base.c	25 Aug 2005 16:57:10 -0000
@@ -24,6 +24,7 @@
 
 #include <bonobo/bonobo-main.h>
 #include <libgnomevfs/gnome-vfs.h>
+#include <gdk/gdkx.h>
 
 #include <string.h>
 
@@ -53,6 +54,7 @@ static void           yelp_base_new_wind
 						     YelpBase       *base);
 static void           yelp_base_window_finalized_cb (YelpBase       *base,
 						     YelpWindow     *window);
+static Time         slowly_and_stupidly_obtain_timestamp (Display *xdisplay);
 
 
 #define PARENT_TYPE BONOBO_OBJECT_TYPE
@@ -187,12 +189,64 @@ yelp_base_new (void)
         return base;
 }
 
+/* Copied from libnaultilus/nautilus-program-choosing.c, via gnome-terminal;
+ * Needed to establish the current timestamp
+ */
+
+static Time
+slowly_and_stupidly_obtain_timestamp (Display *xdisplay)
+{
+	Window xwindow;
+	XEvent event;
+	
+	{
+		XSetWindowAttributes attrs;
+		Atom atom_name;
+		Atom atom_type;
+		char* name;
+		
+		attrs.override_redirect = True;
+		attrs.event_mask = PropertyChangeMask | StructureNotifyMask;
+		
+		xwindow =
+			XCreateWindow (xdisplay,
+				       RootWindow (xdisplay, 0),
+				       -100, -100, 1, 1,
+				       0,
+				       CopyFromParent,
+				       CopyFromParent,
+				       CopyFromParent,
+				       CWOverrideRedirect | CWEventMask,
+				       &attrs);
+		
+		atom_name = XInternAtom (xdisplay, "WM_NAME", TRUE);
+		g_assert (atom_name != None);
+		atom_type = XInternAtom (xdisplay, "STRING", TRUE);
+		g_assert (atom_type != None);
+		
+		name = "Fake Window";
+		XChangeProperty (xdisplay,
+				 xwindow, atom_name,
+				 atom_type,
+				 8, PropModeReplace, name, strlen (name));
+	}
+	
+	XWindowEvent (xdisplay,
+		      xwindow,
+		      PropertyChangeMask,
+		      &event);
+	XDestroyWindow(xdisplay, xwindow);
+	
+	return event.xproperty.time;
+}
+
 GtkWidget *
 yelp_base_new_window (YelpBase *base, const gchar *uri)
 {
 	YelpBasePriv *priv;
 	GtkWidget    *window;
-        
+	gulong timestamp;
+
         g_return_val_if_fail (YELP_IS_BASE (base), NULL);
 
 	priv = base->priv;
@@ -210,6 +264,13 @@ yelp_base_new_window (YelpBase *base, co
 			  base);
 
 	gtk_widget_show (window);
+
+	/*Get the current timestamp as GDK_CURRENT_TIME doesn't seem to 
+	 *do it for Yelp
+	 */
+	timestamp = slowly_and_stupidly_obtain_timestamp (gdk_display);
+
+	gtk_window_present_with_time (GTK_WINDOW (window), timestamp);
 
 	if (uri && uri[0] != '\0')
 		yelp_window_load (YELP_WINDOW (window), uri);
