changeset 77574:b3ee2b840a3b

(xg_update_menubar, create_menus): Create empty submenu for menu bar items.
author Jan Djärv <jan.h.d@swipnet.se>
date Fri, 27 Apr 2007 06:39:33 +0000
parents c7e360cec7a2
children f37a630c73d3
files src/gtkutil.c
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkutil.c	Fri Apr 27 06:39:15 2007 +0000
+++ b/src/gtkutil.c	Fri Apr 27 06:39:33 2007 +0000
@@ -2192,7 +2192,9 @@
                                       cl_data,
                                       &group);
 
-          if (item->contents)
+          /* Create a possibly empty submenu for menu bar items, since some
+             themes don't highlight items correctly without it. */
+          if (item->contents || menu_bar_p)
             {
               GtkWidget *submenu = create_menus (item->contents,
                                                  f,
@@ -2479,8 +2481,14 @@
                                                  cl_data,
                                                  &group);
 
+          /* Create a possibly empty submenu for menu bar items, since some
+             themes don't highlight items correctly without it. */
+          GtkWidget *submenu = create_menus (NULL, f,
+                                             select_cb, NULL, highlight_cb,
+                                             0, 0, 0, 0, cl_data, 0);
           gtk_widget_set_name (w, MENU_ITEM_NAME);
           gtk_menu_shell_insert (GTK_MENU_SHELL (menubar), w, pos);
+          gtk_menu_item_set_submenu (GTK_MENU_ITEM (w), submenu);
 
           g_list_free (*list);
           *list = iter = gtk_container_get_children (GTK_CONTAINER (menubar));