File gnome-panel-2-11-bring-back-my-run-item.patch of Package gnome-panel
diff -Naurp gnome-panel-2.22.1.1/gnome-panel/menu.c gnome-panel-2.22.1.1-patched/gnome-panel/menu.c
--- gnome-panel-2.22.1.1/gnome-panel/menu.c 2008-04-08 14:24:15.000000000 +0200
+++ gnome-panel-2.22.1.1-patched/gnome-panel/menu.c 2008-04-21 16:57:18.000000000 +0200
@@ -1833,6 +1833,12 @@ main_menu_append (GtkWidget *main_menu,
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);
}
diff -Naurp gnome-panel-2.22.1.1/gnome-panel/panel-menu-bar.c gnome-panel-2.22.1.1-patched/gnome-panel/panel-menu-bar.c
--- gnome-panel-2.22.1.1/gnome-panel/panel-menu-bar.c 2008-04-08 14:24:15.000000000 +0200
+++ gnome-panel-2.22.1.1-patched/gnome-panel/panel-menu-bar.c 2008-04-21 17:10:00.000000000 +0200
@@ -123,6 +123,65 @@ panel_menu_bar_setup_tooltip (PanelMenuB
}
static void
+panel_menu_bar_append_applications_menu (GtkWidget *menu,
+ PanelMenuBar *menubar)
+{
+ GtkWidget *item;
+ gboolean add_separator;
+ GList *children;
+ GList *last;
+
+ item = panel_menu_items_create_action_item (PANEL_ACTION_RUN);
+ if (!item)
+ return;
+
+ add_separator = FALSE;
+ children = gtk_container_get_children (GTK_CONTAINER (menu));
+ last = g_list_last (children);
+
+ if (last != NULL)
+ add_separator = !GTK_IS_SEPARATOR (GTK_WIDGET (last->data));
+
+ g_list_free (children);
+
+ 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_object_set_data (G_OBJECT (applications_menu),
+ "panel-menu-append-callback",
+ panel_menu_bar_append_applications_menu);
+ g_object_set_data (G_OBJECT (applications_menu),
+ "panel-menu-append-callback-data",
+ menubar);
+
+ return applications_menu;
+}
+
+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_init (PanelMenuBar *menubar)
{
GtkWidget *image;
@@ -131,7 +190,7 @@ panel_menu_bar_init (PanelMenuBar *menub
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_ICON_MAIN_MENU,
@@ -154,6 +213,9 @@ panel_menu_bar_init (PanelMenuBar *menub
panel_menu_bar_setup_tooltip (menubar);
+ panel_lockdown_notify_add (G_CALLBACK (panel_menu_bar_recreate_menus),
+ menubar);
+
panel_menu_bar_update_text_gravity (menubar);
g_signal_connect (menubar, "screen-changed",
G_CALLBACK (panel_menu_bar_update_text_gravity),
@@ -255,6 +317,17 @@ panel_menu_bar_size_allocate (GtkWidget
panel_menu_bar_change_background (PANEL_MENU_BAR (widget));
}
+ static void
+panel_menu_bar_finalize (GObject *object)
+{
+ PanelMenuBar *menubar = (PanelMenuBar *) object;
+
+ panel_lockdown_notify_remove (G_CALLBACK (panel_menu_bar_recreate_menus),
+ menubar);
+
+ G_OBJECT_CLASS (panel_menu_bar_parent_class)->finalize (object);
+}
+
static void
panel_menu_bar_class_init (PanelMenuBarClass *klass)
{
@@ -263,6 +336,7 @@ panel_menu_bar_class_init (PanelMenuBarC
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;
diff -Naurp gnome-panel-2.22.1.1/gnome-panel/panel-menu-items.c gnome-panel-2.22.1.1-patched/gnome-panel/panel-menu-items.c
--- gnome-panel-2.22.1.1/gnome-panel/panel-menu-items.c 2008-04-08 14:24:15.000000000 +0200
+++ gnome-panel-2.22.1.1-patched/gnome-panel/panel-menu-items.c 2008-04-21 16:56:35.000000000 +0200
@@ -318,7 +318,7 @@ panel_menu_items_create_action_item_full
return item;
}
-static GtkWidget *
+GtkWidget *
panel_menu_items_create_action_item (PanelActionButtonType action_type)
{
return panel_menu_items_create_action_item_full (action_type,
diff -Naurp gnome-panel-2.22.1.1/gnome-panel/panel-menu-items.h gnome-panel-2.22.1.1-patched/gnome-panel/panel-menu-items.h
--- gnome-panel-2.22.1.1/gnome-panel/panel-menu-items.h 2008-04-08 14:24:15.000000000 +0200
+++ gnome-panel-2.22.1.1-patched/gnome-panel/panel-menu-items.h 2008-04-21 16:56:32.000000000 +0200
@@ -91,6 +91,9 @@ void panel_menu_items_append_lock_logout
void panel_menu_item_activate_desktop_file (GtkWidget *menuitem,
const char *path);
+
+GtkWidget *panel_menu_items_create_action_item (PanelActionButtonType action_type);
+
G_END_DECLS
#endif /* __PANEL_MENU_ITEMS_H__ */