Index: libgnome-desktop/gnome-desktop-item.c
===================================================================
RCS file: /cvs/gnome/gnome-desktop/libgnome-desktop/gnome-desktop-item.c,v
retrieving revision 1.133
diff -p -u -r1.133 gnome-desktop-item.c
--- libgnome-desktop/gnome-desktop-item.c	29 Feb 2004 13:23:40 -0000	1.133
+++ libgnome-desktop/gnome-desktop-item.c	23 Jun 2004 19:22:48 -0000
@@ -1572,6 +1572,61 @@ stringify_files (GSList *args)
 	return g_string_free (str, FALSE);
 }
 
+/* FIXME: This is the wrong way to do this; there should be some event
+ * (e.g. button press) available with a good time.  A function like
+ * this should not be needed.
+ */
+static Time
+slowly_and_stupidly_obtain_timestamp(SnDisplay *display)
+{
+  Window xwindow;
+  Display *xdisplay;
+  XEvent event;
+
+  xdisplay = sn_display_get_x_display (display);
+
+  {
+    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);
+    assert(atom_name != None);
+    atom_type = XInternAtom(xdisplay, "STRING", TRUE);
+    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;
+}
+
 static int
 ditem_execute (const GnomeDesktopItem *item,
 	       const char *exec,
@@ -1756,6 +1811,10 @@ ditem_execute (const GnomeDesktopItem *i
 		if (sn_context != NULL &&
 		    !sn_launcher_context_get_initiated (sn_context)) {
 
+			Time timestamp;
+
+			timestamp = slowly_and_stupidly_obtain_xserver_timestamp (sn_display);
+
 			/* This means that we always use the first real_argv[0]
 			 * we select for the "binary name", but it's probably
 			 * OK to do that. Binary name isn't super-important
@@ -1769,7 +1828,7 @@ ditem_execute (const GnomeDesktopItem *i
 			sn_launcher_context_initiate (sn_context,
 						      g_get_prgname () ? g_get_prgname () : "unknown",
 						      real_argv[0],
-						      CurrentTime);
+						      timestamp);
 
 			envp = make_spawn_environment_for_sn_context (sn_context, envp);
 			if (free_me)
