diff src/gtkutil.c @ 77511:1962a74982ce

(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:21:16 +0000
parents bb6e75c27940
children 922696f363b0 41aaac7180d5 70bf32a0f523
line wrap: on
line diff
--- a/src/gtkutil.c	Fri Apr 27 01:18:33 2007 +0000
+++ b/src/gtkutil.c	Fri Apr 27 06:21:16 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));