--- gtk-old/gtkmenu.c	2011-12-12 11:09:08.505651410 +0000
+++ gtk/gtkmenu.c	2011-12-15 13:29:19.059859726 +0000
@@ -1443,6 +1443,35 @@
   return TRUE;
 }
 
+/* Add additional styling info from the parent. */
+static void
+prepend_parent_path (GtkMenu* menu)
+{
+  GtkWidget *attach_widget;
+
+  attach_widget = gtk_menu_get_attach_widget (menu);
+
+  if (attach_widget)
+    {
+      GtkStyleContext *context, *parent_context;
+      const GtkWidgetPath *parent_path;
+      GtkWidgetPath *path;
+
+      context = gtk_widget_get_style_context (GTK_WIDGET (menu));
+      parent_context = gtk_widget_get_style_context (attach_widget);
+
+      /* Copy the widget path of the parent,
+       * append the type of the actual menu,
+       * set this path as the new path for the menu. */
+      parent_path = gtk_style_context_get_path (parent_context);
+      path = gtk_widget_path_copy (parent_path);
+      gtk_widget_path_append_type (path, G_OBJECT_TYPE (menu));
+      gtk_style_context_set_path (context, path);
+
+      gtk_widget_path_free (path);
+    }
+}
+
 /**
  * gtk_menu_popup_for_device:
  * @menu: a #GtkMenu
@@ -1669,6 +1698,9 @@
   priv->position_func_data_destroy = destroy;
   menu_shell->priv->activate_time = activate_time;
 
+  /* Prepend the path of the parent. */
+  prepend_parent_path (menu);
+
   /* We need to show the menu here rather in the init function
    * because code expects to be able to tell if the menu is onscreen
    * by looking at gtk_widget_get_visible (menu)
@@ -2467,6 +2499,11 @@
       gtk_style_context_set_background (context, priv->view_window);
       gtk_style_context_set_background (context, gtk_widget_get_window (widget));
     }
+  else
+    {
+      /* Prepend the path of the parent. */
+      prepend_parent_path (GTK_MENU (widget));
+    }
 }
 
 static void
