Index: gtk/gtkuimanager.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkuimanager.c,v
retrieving revision 1.101
diff -u -r1.101 gtkuimanager.c
--- gtk/gtkuimanager.c	14 May 2006 04:25:33 -0000	1.101
+++ gtk/gtkuimanager.c	26 Jun 2006 13:09:03 -0000
@@ -42,6 +42,7 @@
 #include "gtktearoffmenuitem.h"
 #include "gtktoolbar.h"
 #include "gtkuimanager.h"
+#include "gtkrecentaction.h"
 #include "gtkprivate.h"
 #include "gtkalias.h"
 
@@ -2215,20 +2216,36 @@
 	  {
 	    GtkWidget *tearoff;
 	    GtkWidget *filler;
-	    
-	    menu = gtk_menu_new ();
-	    gtk_widget_set_name (menu, info->name);
-	    tearoff = gtk_tearoff_menu_item_new ();
-	    gtk_widget_set_no_show_all (tearoff, TRUE);
-	    gtk_menu_shell_append (GTK_MENU_SHELL (menu), tearoff);
-	    filler = gtk_menu_item_new_with_label (_("Empty"));
-	    g_object_set_data (G_OBJECT (filler),
-			       I_("gtk-empty-menu-item"),
-			       GINT_TO_POINTER (TRUE));
-	    gtk_widget_set_sensitive (filler, FALSE);
-	    gtk_widget_set_no_show_all (filler, TRUE);
-	    gtk_menu_shell_append (GTK_MENU_SHELL (menu), filler);
-	    
+
+	    /* hacky way to make recent files work with toolitems
+	     */
+	    if (NODE_INFO (node->parent)->type == NODE_TYPE_TOOLITEM &&
+		GTK_IS_RECENT_ACTION (action))
+	      {
+		GtkMenuItem *item;
+
+		item = gtk_action_create_menu_item (action);
+		menu = gtk_menu_item_get_submenu (item);
+		g_object_ref (menu);
+		gtk_menu_item_remove_submenu (item);
+		gtk_widget_destroy (item);
+	      }
+	    else
+	      {
+		menu = gtk_menu_new ();
+		gtk_widget_set_name (menu, info->name);
+		tearoff = gtk_tearoff_menu_item_new ();
+		gtk_widget_set_no_show_all (tearoff, TRUE);
+		gtk_menu_shell_append (GTK_MENU_SHELL (menu), tearoff);
+		filler = gtk_menu_item_new_with_label (_("Empty"));
+		g_object_set_data (G_OBJECT (filler),
+				   I_("gtk-empty-menu-item"),
+				   GINT_TO_POINTER (TRUE));
+		gtk_widget_set_sensitive (filler, FALSE);
+		gtk_widget_set_no_show_all (filler, TRUE);
+		gtk_menu_shell_append (GTK_MENU_SHELL (menu), filler);
+	      }
+
 	    if (NODE_INFO (node->parent)->type == NODE_TYPE_TOOLITEM)
 	      {
 		info->proxy = menu;
