changeset 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 bf14ac338d39
children a6e346d8c886
files src/gtkutil.c
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
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));