diff -ur mate-panel-1.22.0-orig/mate-panel/menu.c mate-panel-1.22.0/mate-panel/menu.c --- mate-panel-1.22.0-orig/mate-panel/menu.c 2019-04-10 21:52:39.987978574 +0000 +++ mate-panel-1.22.0/mate-panel/menu.c 2019-04-10 21:52:48.584177316 +0000 @@ -1187,6 +1187,11 @@ g_object_set_data (G_OBJECT (menu), "panel-menu-needs-loading", GUINT_TO_POINTER (TRUE)); + /* Well, only mate-applications.menu needs appending, but other menus don't have + corresponding "show" signal handler anyway */ + g_object_set_data (G_OBJECT (menu), + "panel-menu-needs-appending", + TRUE); idle_id = g_idle_add_full (G_PRIORITY_LOW, submenu_to_display_in_idle, @@ -1207,6 +1212,52 @@ menu); } +void +run_applications (GtkWidget *widget, gpointer user_data) +{ + if (!panel_lockdown_get_disable_command_line()) { + panel_run_dialog_present (gtk_widget_get_screen (widget), + gtk_get_current_event_time ()); + } +} + +void +applications_menu_append (GtkWidget *main_menu) +{ + GtkWidget *item; + GtkWidget *accel_label; + GtkWidget *image; + + if (panel_lockdown_get_disable_command_line()) + return; + + if (!g_object_get_data (G_OBJECT (main_menu), + "panel-menu-needs-appending")) + return; + + g_object_set_data (G_OBJECT (main_menu), + "panel-menu-needs-appending", NULL); + + add_menu_separator (main_menu); + + item = gtk_image_menu_item_new (); + + accel_label = gtk_accel_label_new (_("Run Application...")); + gtk_misc_set_alignment (GTK_MISC (accel_label), 0.0, 0.5); + + gtk_container_add (GTK_CONTAINER (item), accel_label); + gtk_accel_label_set_accel_widget (GTK_ACCEL_LABEL (accel_label), + GTK_WIDGET (item)); + gtk_widget_show (accel_label); + + image = gtk_image_new_from_icon_name (PANEL_ICON_RUN, panel_menu_icon_get_size ()); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image); + + g_signal_connect (item, "activate", G_CALLBACK (run_applications), NULL); + gtk_menu_shell_append (GTK_MENU_SHELL (main_menu), item); + gtk_widget_show (item); +} + GtkWidget * create_applications_menu (const char *menu_file, const char *menu_path, diff -ur mate-panel-1.22.0-orig/mate-panel/menu.h mate-panel-1.22.0/mate-panel/menu.h --- mate-panel-1.22.0-orig/mate-panel/menu.h 2019-04-10 21:52:39.981037692 +0000 +++ mate-panel-1.22.0/mate-panel/menu.h 2019-04-10 21:52:48.584765675 +0000 @@ -70,6 +70,8 @@ gboolean menu_dummy_button_press_event (GtkWidget *menuitem, GdkEventButton *event); +void run_applications (GtkWidget *widget, gpointer user_data); +void applications_menu_append (GtkWidget *main_menu); #ifdef __cplusplus diff -ur mate-panel-1.22.0-orig/mate-panel/panel-menu-bar.c mate-panel-1.22.0/mate-panel/panel-menu-bar.c --- mate-panel-1.22.0-orig/mate-panel/panel-menu-bar.c 2019-04-10 21:52:39.991470004 +0000 +++ mate-panel-1.22.0/mate-panel/panel-menu-bar.c 2019-04-10 21:52:48.586036900 +0000 @@ -179,6 +179,9 @@ menubar->priv->applications_menu = create_applications_menu("mate-applications.menu", NULL, TRUE); + g_object_set_data (G_OBJECT (menubar->priv->applications_menu), "panel-menu-needs-appending", TRUE); + g_signal_connect (menubar->priv->applications_menu, "show", G_CALLBACK(applications_menu_append), NULL); + menubar->priv->applications_item = panel_image_menu_item_new(); gtk_menu_item_set_label(GTK_MENU_ITEM(menubar->priv->applications_item), _("Applications")); diff -ur mate-panel-1.22.0-orig/mate-panel/panel-menu-items.c mate-panel-1.22.0/mate-panel/panel-menu-items.c --- mate-panel-1.22.0-orig/mate-panel/panel-menu-items.c 2019-04-10 21:52:39.992314690 +0000 +++ mate-panel-1.22.0/mate-panel/panel-menu-items.c 2019-04-10 21:52:48.585514124 +0000 @@ -1222,6 +1222,8 @@ panel_menu_items_append_from_desktop (menu, "mate-user-guide.desktop", NULL, FALSE); + panel_menu_items_append_from_desktop (menu, "openindiana-about.desktop", NULL, FALSE); + panel_menu_items_append_from_desktop (menu, "mate-about.desktop", NULL, FALSE); if (parent->priv->append_lock_logout)