File gnome-panel-2-11-bring-back-my-run-item.patch of Package gnome-panel-nld

Index: gnome-panel/menu.c
================================================================================
--- gnome-panel/menu.c
+++ gnome-panel/menu.c
@@ -1741,6 +1741,12 @@
 	gtk_menu_shell_append (GTK_MENU_SHELL (main_menu), item);
 	gtk_widget_show (item);
 
+	item = panel_menu_items_create_action_item (PANEL_ACTION_RUN);
+	if (item != NULL) {
+		add_menu_separator (main_menu);
+		gtk_menu_shell_append (GTK_MENU_SHELL (main_menu), item);
+	}
+
 	panel_menu_items_append_lock_logout (main_menu);
 }
 
--- gnome-panel/panel-menu-bar.c
+++ gnome-panel/panel-menu-bar.c
@@ -63,6 +63,68 @@
 };
 
 static GObjectClass *parent_class;
+static GtkWidget *panel_menu_bar_create_applications_menu (PanelMenuBar *menubar);
+
+static void
+panel_menu_bar_recreate_menus (PanelMenuBar *menubar)
+{
+	if (menubar->priv->applications_menu) {
+		gtk_widget_destroy (menubar->priv->applications_menu);
+		menubar->priv->applications_menu = panel_menu_bar_create_applications_menu (menubar);
+		panel_applet_menu_set_recurse (GTK_MENU (menubar->priv->applications_menu),
+					       "menu_panel",
+					       menubar->priv->panel);
+		gtk_menu_item_set_submenu (GTK_MENU_ITEM (menubar->priv->applications_item),
+					   menubar->priv->applications_menu);
+	}
+}
+
+static void
+panel_menu_bar_append_applications_menu (GtkWidget    *menu,
+					 PanelMenuBar *menubar)
+{
+	GtkWidget *item;
+
+	if (!g_object_get_data (G_OBJECT (menu), "panel-menu-needs-appending"))
+		return;
+
+	g_object_set_data (G_OBJECT (menu), "panel-menu-needs-appending", NULL);
+
+	item = panel_menu_items_create_action_item (PANEL_ACTION_RUN);
+
+	if (item != NULL) {
+		gboolean  add_separator;
+		GList    *children;
+
+		children = gtk_container_get_children (GTK_CONTAINER (menu));
+
+		add_separator = FALSE;
+		if (children != NULL) {
+			while (children->next != NULL)
+				children = children->next;
+			add_separator = !GTK_IS_SEPARATOR (GTK_WIDGET (children->data));
+		}
+
+		if (add_separator)
+			add_menu_separator (menu);
+
+		gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+	}
+}
+
+static GtkWidget *
+panel_menu_bar_create_applications_menu (PanelMenuBar *menubar)
+{
+	GtkWidget *applications_menu;
+
+	applications_menu = create_applications_menu ("applications.menu", NULL);
+
+	g_signal_connect (applications_menu, "show",
+			  G_CALLBACK (panel_menu_bar_append_applications_menu),
+			  menubar);
+
+	return applications_menu;
+}
 
 static void
 panel_menu_bar_instance_init (PanelMenuBar      *menubar,
@@ -74,7 +136,7 @@
 
 	menubar->priv->info = NULL;
 
-	menubar->priv->applications_menu = create_applications_menu ("applications.menu", NULL);
+	menubar->priv->applications_menu = panel_menu_bar_create_applications_menu (menubar);
 
 	menubar->priv->applications_item = gtk_image_menu_item_new_with_label (_("Applications"));
 	image = gtk_image_new_from_icon_name (PANEL_GNOME_LOGO_ICON,
@@ -94,6 +156,9 @@
 	menubar->priv->desktop_item = panel_desktop_menu_item_new (FALSE, TRUE);
 	gtk_menu_shell_append (GTK_MENU_SHELL (menubar),
 			       menubar->priv->desktop_item);
+
+	panel_lockdown_notify_add (G_CALLBACK (panel_menu_bar_recreate_menus),
+				   menubar);
 }
 
 static void
@@ -185,6 +250,17 @@
 }
 
 static void
+panel_menu_bar_finalize (GObject *object)
+{
+	PanelMenuBar *menubar = (PanelMenuBar *) object;
+
+	panel_lockdown_notify_remove (G_CALLBACK (panel_menu_bar_recreate_menus),
+				      menubar);
+
+	parent_class->finalize (object);
+}
+
+static void
 panel_menu_bar_class_init (PanelMenuBarClass *klass)
 {
 	GObjectClass   *gobject_class = (GObjectClass   *) klass;
@@ -195,6 +271,7 @@
 	gobject_class->get_property = panel_menu_bar_get_property;
         gobject_class->set_property = panel_menu_bar_set_property;
 
+	gobject_class->finalize  = panel_menu_bar_finalize;
 	widget_class->parent_set = panel_menu_bar_parent_set;
 	widget_class->size_allocate = panel_menu_bar_size_allocate;