Common subdirectories: gnome-panel-2.27.4.orig/gnome-panel/libpanel-util and gnome-panel-2.27.4/gnome-panel/libpanel-util
diff -u gnome-panel-2.27.4.orig/gnome-panel/panel-recent.c gnome-panel-2.27.4/gnome-panel/panel-recent.c
--- gnome-panel-2.27.4.orig/gnome-panel/panel-recent.c	2009-07-01 15:06:23.000000000 +0200
+++ gnome-panel-2.27.4/gnome-panel/panel-recent.c	2009-08-16 02:49:15.000000000 +0200
@@ -49,20 +49,14 @@
 					       error);
 }
 
-
 static void
-recent_documents_activate_cb (GtkRecentChooser *chooser,
-			      gpointer          data)
+open_recent (GtkRecentInfo *recent_info,
+	     GdkScreen     *screen)
 {
-	GtkRecentInfo *recent_info;
 	const char    *uri;
 	const char    *mime_type;
-	GdkScreen     *screen;
 	GError        *error = NULL;
 
-	screen = gtk_widget_get_screen (GTK_WIDGET (chooser));
-	
-	recent_info = gtk_recent_chooser_get_current_item (chooser);
 	uri = gtk_recent_info_get_uri (recent_info);
 	mime_type = gtk_recent_info_get_mime_type (recent_info);
 	//FIXME gtk_recent_info_get_application_info() could be useful
@@ -98,12 +92,140 @@
 
 		g_free (uri_utf8);
 	}
+}
+
+static void
+recent_documents_activate_cb (GtkRecentChooser *chooser,
+			      gpointer          data)
+{
+	GtkRecentInfo *recent_info;
+	GdkScreen     *screen;
+
+	screen = gtk_widget_get_screen (GTK_WIDGET (chooser));
+	recent_info = gtk_recent_chooser_get_current_item (chooser);
+
+	open_recent (recent_info, screen);
 
 	/* we can unref it only after having used the data we fetched from it */
 	gtk_recent_info_unref (recent_info);
 }
 
 static void
+context_open (GtkWidget	       *item,
+	      GtkRecentChooser *chooser)
+{
+	GtkRecentInfo *recent_info;
+	GdkScreen     *screen;
+
+	screen = gtk_widget_get_screen (GTK_WIDGET (chooser));
+	recent_info = gtk_recent_chooser_get_current_item (chooser);
+
+	open_recent (recent_info, screen);
+
+	/* we can unref it only after having used the data we fetched from it */
+	gtk_recent_info_unref (recent_info);
+}
+
+static void
+activate_uri_on_screen (const char *uri,
+			GdkScreen  *screen)
+{
+	panel_show_uri (screen, uri, gtk_get_current_event_time (), NULL);
+}
+
+static void
+activate_uri (GtkWidget  *menuitem,
+	      const char *uri)
+{
+	activate_uri_on_screen (uri, gtk_widget_get_screen (GTK_WIDGET (menuitem)));
+}
+
+static gboolean
+panel_recent_item_show_menu (GtkWidget        *item,
+			     GdkEventButton   *bevent,
+			     GtkRecentChooser *chooser)
+{
+	GtkWidget     *menu;
+	GtkWidget     *menuitem;
+	GtkRecentInfo *recent_info;
+	GFile	      *file;
+	GFile	      *parent;
+	const char    *uri;
+	char 	      *parent_uri;
+	GdkScreen     *screen;
+
+	menu = gtk_menu_new ();
+
+	menuitem = gtk_menu_item_new_with_mnemonic (_("_Open"));
+	g_signal_connect (menuitem, "activate",
+			  G_CALLBACK (context_open),
+			  chooser);
+	gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+	gtk_widget_show (menuitem);
+
+	recent_info = gtk_recent_chooser_get_current_item (chooser);
+	uri = gtk_recent_info_get_uri (recent_info);
+	file = g_file_new_for_uri (uri);
+	parent = g_file_get_parent (file);
+	
+	parent_uri = g_file_get_uri (parent);
+
+	menuitem = gtk_menu_item_new_with_mnemonic (_("Open Parent _Folder"));
+	g_signal_connect_data (menuitem, "activate",
+			       G_CALLBACK (activate_uri),
+			       parent_uri,
+			       (GClosureNotify) g_free,
+			       0);
+	gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+	gtk_widget_show (menuitem);
+
+	screen = gtk_widget_get_screen (GTK_WIDGET (chooser));
+
+	gtk_menu_set_screen (GTK_MENU (menu), screen);
+
+	gtk_menu_popup (GTK_MENU (menu),
+			NULL, NULL, NULL, NULL,
+			bevent->button,
+			bevent->time);
+
+	g_object_unref (file);
+	g_object_unref (parent);
+	gtk_recent_info_unref (recent_info);
+
+	return TRUE;
+}
+
+static gboolean
+panel_recent_item_button_press_event (GtkWidget        *menuitem,
+				      GdkEventButton   *event,
+				      GtkRecentChooser *chooser)
+{
+	if (event->button == 3)
+		return panel_recent_item_show_menu (menuitem, event, chooser);
+
+	return FALSE;
+}
+
+static void
+panel_recent_add_item_signals (GtkWidget *recent_menu)
+{
+	GList *l;
+
+	/* Loop thru children and add button handler for each of the items 
+	 * to handle popoup menu */
+	l = gtk_container_get_children (GTK_CONTAINER (recent_menu));
+	
+	while (l) {
+		GtkWidget *recent_item;
+		recent_item = GTK_WIDGET (l->data);
+		l = l->next;
+		g_signal_connect (G_OBJECT (recent_item), "button_press_event",
+				  G_CALLBACK (panel_recent_item_button_press_event),
+				  recent_menu);
+	}
+}
+
+static void
 panel_recent_manager_changed_cb (GtkRecentManager *manager,
 				 GtkWidget        *menu_item)
 {
@@ -215,6 +337,11 @@
 			  G_CALLBACK (recent_documents_activate_cb),
 			  NULL);
 
+	g_signal_connect (GTK_RECENT_CHOOSER (recent_menu),
+			  "show",
+			  G_CALLBACK (panel_recent_add_item_signals),
+			  NULL);
+
 	//FIXME this is not possible with GtkRecent...: egg_recent_view_gtk_set_icon_size (view, panel_menu_icon_get_size ());
 
 	g_signal_connect_object (manager, "changed",
