diff -uprN gtk+-2.20.1/modules/engines/ms-windows/msw_style.c gtk+-2.20.1.az/modules/engines/ms-windows/msw_style.c
--- gtk+-2.20.1/modules/engines/ms-windows/msw_style.c	2010-07-23 14:42:54 +0200
+++ gtk+-2.20.1.az/modules/engines/ms-windows/msw_style.c	2010-07-23 14:35:04 +0200
@@ -30,6 +30,9 @@
  *  http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/pantdraw_4b3g.asp
  */
 
+/* Include first, else we get redefinition warnings about STRICT */
+#include "pango/pangowin32.h"
+
 #include "msw_style.h"
 #include "xp_theme.h"
 
@@ -79,72 +82,72 @@ typedef enum
 
 #define PART_SIZE 13
 
-static const guint8 check_aa_bits[] = {
+static const gchar check_aa_bits[] = {
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 };
-static const guint8 check_base_bits[] = {
+static const gchar check_base_bits[] = {
   0x00, 0x00, 0x00, 0x00, 0xfc, 0x07, 0xfc, 0x07, 0xfc, 0x07, 0xfc, 0x07,
   0xfc, 0x07, 0xfc,
   0x07, 0xfc, 0x07, 0xfc, 0x07, 0xfc, 0x07, 0x00, 0x00, 0x00, 0x00
 };
-static const guint8 check_black_bits[] = {
+static const gchar check_black_bits[] = {
   0x00, 0x00, 0xfe, 0x0f, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00,
   0x02, 0x00, 0x02,
   0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00
 };
-static const guint8 check_dark_bits[] = {
+static const gchar check_dark_bits[] = {
   0xff, 0x1f, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
   0x01, 0x00, 0x01,
   0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00
 };
-static const guint8 check_light_bits[] = {
+static const gchar check_light_bits[] = {
   0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10,
   0x00, 0x10, 0x00,
   0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0xfe, 0x1f
 };
-static const guint8 check_mid_bits[] = {
+static const gchar check_mid_bits[] = {
   0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08,
   0x00, 0x08, 0x00,
   0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0xfc, 0x0f, 0x00, 0x00
 };
-static const guint8 check_text_bits[] = {
+static const gchar check_text_bits[] = {
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x03, 0x88, 0x03,
   0xd8, 0x01, 0xf8,
   0x00, 0x70, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 };
-static const char check_inconsistent_bits[] = {
+static const gchar check_inconsistent_bits[] = {
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0xf0, 0x03, 0xf0,
   0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 };
-static const guint8 radio_base_bits[] = {
+static const gchar radio_base_bits[] = {
   0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0xf8, 0x03, 0xfc, 0x07, 0xfc, 0x07,
   0xfc, 0x07, 0xfc,
   0x07, 0xfc, 0x07, 0xf8, 0x03, 0xf0, 0x01, 0x00, 0x00, 0x00, 0x00
 };
-static const guint8 radio_black_bits[] = {
+static const gchar radio_black_bits[] = {
   0x00, 0x00, 0xf0, 0x01, 0x0c, 0x02, 0x04, 0x00, 0x02, 0x00, 0x02, 0x00,
   0x02, 0x00, 0x02,
   0x00, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 };
-static const guint8 radio_dark_bits[] = {
+static const gchar radio_dark_bits[] = {
   0xf0, 0x01, 0x0c, 0x06, 0x02, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00,
   0x01, 0x00, 0x01,
   0x00, 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00
 };
-static const guint8 radio_light_bits[] = {
+static const gchar radio_light_bits[] = {
   0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x10, 0x00, 0x10,
   0x00, 0x10, 0x00,
   0x10, 0x00, 0x10, 0x00, 0x08, 0x00, 0x08, 0x0c, 0x06, 0xf0, 0x01
 };
-static const guint8 radio_mid_bits[] = {
+static const gchar radio_mid_bits[] = {
   0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0x08, 0x00, 0x08,
   0x00, 0x08, 0x00,
   0x08, 0x00, 0x08, 0x00, 0x04, 0x0c, 0x06, 0xf0, 0x01, 0x00, 0x00
 };
-static const guint8 radio_text_bits[] = {
+static const gchar radio_text_bits[] = {
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0xf0, 0x01,
   0xf0, 0x01, 0xf0,
   0x01, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
@@ -152,7 +155,7 @@ static const guint8 radio_text_bits[] =
 
 static struct
 {
-  const guint8 *bits;
+  const gchar *bits;
   GdkBitmap *bmap;
 } parts[] = {
   { check_aa_bits, NULL           },
@@ -172,24 +175,22 @@ static struct
 };
 
 static gboolean
-get_system_font (XpThemeClass klazz, XpThemeFont type, LOGFONT *out_lf)
+get_system_font (XpThemeClass klazz, XpThemeFont type, LOGFONTW *out_lf)
 {
-#if 0
-  /* TODO: this causes crashes later because the font name is in UCS2, and
-     the pango fns don't deal with that gracefully */
   if (xp_theme_get_system_font (klazz, type, out_lf))
     {
       return TRUE;
     }
   else
-#endif
     {
-      NONCLIENTMETRICS ncm;
+      /* Use wide char versions here, as the theming functions only support
+       * wide chars versions of the structures. */
+      NONCLIENTMETRICSW ncm;
 
-      ncm.cbSize = sizeof (NONCLIENTMETRICS);
+      ncm.cbSize = sizeof (NONCLIENTMETRICSW);
 
-      if (SystemParametersInfo (SPI_GETNONCLIENTMETRICS,
-				sizeof (NONCLIENTMETRICS), &ncm, 0))
+      if (SystemParametersInfoW (SPI_GETNONCLIENTMETRICS,
+				sizeof (NONCLIENTMETRICSW), &ncm, 0))
 	{
 	  if (type == XP_THEME_FONT_CAPTION)
 	    *out_lf = ncm.lfCaptionFont;
@@ -207,312 +208,56 @@ get_system_font (XpThemeClass klazz, XpT
   return FALSE;
 }
 
-/***************************** BEGIN STOLEN FROM PANGO *****************************/
-
-/*
-	This code is stolen from Pango 1.4. It attempts to address the following problems:
-
-	http://bugzilla.gnome.org/show_bug.cgi?id=135098
-	http://sourceforge.net/tracker/index.php?func=detail&aid=895762&group_id=76416&atid=547655
-
-	As Owen suggested in bug 135098, once Pango 1.6 is released, we need to get rid of this code.
-*/
-
-#define PING(printlist)
-
-/* TrueType defines: */
-
-#define MAKE_TT_TABLE_NAME(c1, c2, c3, c4) \
-   (((guint32)c4) << 24 | ((guint32)c3) << 16 | ((guint32)c2) << 8 | ((guint32)c1))
-
-#define CMAP (MAKE_TT_TABLE_NAME('c','m','a','p'))
-#define CMAP_HEADER_SIZE 4
-
-#define NAME (MAKE_TT_TABLE_NAME('n','a','m','e'))
-#define NAME_HEADER_SIZE 6
-
-#define ENCODING_TABLE_SIZE 8
-
-#define APPLE_UNICODE_PLATFORM_ID 0
-#define MACINTOSH_PLATFORM_ID 1
-#define ISO_PLATFORM_ID 2
-#define MICROSOFT_PLATFORM_ID 3
-
-#define SYMBOL_ENCODING_ID 0
-#define UNICODE_ENCODING_ID 1
-#define UCS4_ENCODING_ID 10
-
-struct name_header
-{
-  guint16 format_selector;
-  guint16 num_records;
-  guint16 string_storage_offset;
-};
-
-struct name_record
-{
-  guint16 platform_id;
-  guint16 encoding_id;
-  guint16 language_id;
-  guint16 name_id;
-  guint16 string_length;
-  guint16 string_offset;
-};
-
-static gboolean
-pango_win32_get_name_header (HDC hdc, struct name_header *header)
-{
-  if (GetFontData (hdc, NAME, 0, header, sizeof (*header)) != sizeof (*header))
-    return FALSE;
-
-  header->num_records = GUINT16_FROM_BE (header->num_records);
-  header->string_storage_offset = GUINT16_FROM_BE (header->string_storage_offset);
-
-  return TRUE;
-}
-
-static gboolean
-pango_win32_get_name_record (HDC hdc, gint i, struct name_record *record)
-{
-  if (GetFontData (hdc, NAME, 6 + i * sizeof (*record),
-		   record, sizeof (*record)) != sizeof (*record))
-    {
-      return FALSE;
-    }
-
-  record->platform_id = GUINT16_FROM_BE (record->platform_id);
-  record->encoding_id = GUINT16_FROM_BE (record->encoding_id);
-  record->language_id = GUINT16_FROM_BE (record->language_id);
-  record->name_id = GUINT16_FROM_BE (record->name_id);
-  record->string_length = GUINT16_FROM_BE (record->string_length);
-  record->string_offset = GUINT16_FROM_BE (record->string_offset);
-
-  return TRUE;
-}
-
-static gchar *
-get_family_name (LOGFONT *lfp, HDC pango_win32_hdc)
-{
-  HFONT hfont;
-  HFONT oldhfont;
-
-  struct name_header header;
-  struct name_record record;
-
-  gint unicode_ix = -1, mac_ix = -1, microsoft_ix = -1;
-  gint name_ix;
-  gchar *codeset;
-
-  gchar *string = NULL;
-  gchar *name;
-
-  size_t i, l, nbytes;
-
-  /* If lfFaceName is ASCII, assume it is the common (English) name for the
-     font. Is this valid? Do some TrueType fonts have different names in
-     French, German, etc, and does the system return these if the locale is
-     set to use French, German, etc? */
-  l = strlen (lfp->lfFaceName);
-  for (i = 0; i < l; i++)
-    {
-      if (lfp->lfFaceName[i] < ' ' || lfp->lfFaceName[i] > '~')
-	{
-	  break;
-	}
-    }
-
-  if (i == l)
-    return g_strdup (lfp->lfFaceName);
-
-  if ((hfont = CreateFontIndirect (lfp)) == NULL)
-    goto fail0;
-
-  if ((oldhfont = (HFONT) SelectObject (pango_win32_hdc, hfont)) == NULL)
-    goto fail1;
-
-  if (!pango_win32_get_name_header (pango_win32_hdc, &header))
-    goto fail2;
-
-  PING (("%d name records", header.num_records));
-
-  for (i = 0; i < header.num_records; i++)
-    {
-      if (!pango_win32_get_name_record (pango_win32_hdc, i, &record))
-	goto fail2;
-
-      if ((record.name_id != 1 && record.name_id != 16) || record.string_length <= 0)
-	continue;
-
-      PING (("platform:%d encoding:%d language:%04x name_id:%d",
-	     record.platform_id, record.encoding_id, record.language_id,
-	     record.name_id));
-
-      if (record.platform_id == APPLE_UNICODE_PLATFORM_ID ||
-	  record.platform_id == ISO_PLATFORM_ID)
-	{
-	  unicode_ix = i;
-	}
-      else if (record.platform_id == MACINTOSH_PLATFORM_ID && record.encoding_id == 0 &&	/* Roman
-												 */
-	       record.language_id == 0)	/* English */
-	{
-	  mac_ix = i;
-	}
-      else if (record.platform_id == MICROSOFT_PLATFORM_ID)
-	{
-	  if ((microsoft_ix == -1 ||
-	       PRIMARYLANGID (record.language_id) == LANG_ENGLISH) &&
-	      (record.encoding_id == SYMBOL_ENCODING_ID ||
-	       record.encoding_id == UNICODE_ENCODING_ID ||
-	       record.encoding_id == UCS4_ENCODING_ID))
-	    {
-	      microsoft_ix = i;
-	    }
-	}
-    }
-
-  if (microsoft_ix >= 0)
-    name_ix = microsoft_ix;
-  else if (mac_ix >= 0)
-    name_ix = mac_ix;
-  else if (unicode_ix >= 0)
-    name_ix = unicode_ix;
-  else
-    goto fail2;
-
-  if (!pango_win32_get_name_record (pango_win32_hdc, name_ix, &record))
-    goto fail2;
-
-  string = g_malloc (record.string_length + 1);
-  if (GetFontData (pango_win32_hdc, NAME,
-		   header.string_storage_offset + record.string_offset,
-		   string, record.string_length) != record.string_length)
-    goto fail2;
-
-  string[record.string_length] = '\0';
-
-  if (name_ix == microsoft_ix)
-    {
-      if (record.encoding_id == SYMBOL_ENCODING_ID ||
-	  record.encoding_id == UNICODE_ENCODING_ID)
-	{
-	  codeset = "UTF-16BE";
-	}
-      else
-	{
-	  codeset = "UCS-4BE";
-	}
-    }
-  else if (name_ix == mac_ix)
-    {
-      codeset = "MacRoman";
-    }
-  else				/* name_ix == unicode_ix */
-    {
-      codeset = "UCS-4BE";
-    }
-
-
-  name = g_convert (string, record.string_length, "UTF-8", codeset, NULL,
-		    &nbytes, NULL);
-  if (name == NULL)
-    goto fail2;
-
-  g_free (string);
-
-  PING (("%s", name));
-
-  SelectObject (pango_win32_hdc, oldhfont);
-  DeleteObject (hfont);
-
-  return name;
-
-fail2:
-  g_free (string);
-  SelectObject (pango_win32_hdc, oldhfont);
-
-fail1:
-  DeleteObject (hfont);
-
-fail0:
-  return g_locale_to_utf8 (lfp->lfFaceName, -1, NULL, NULL, NULL);
-}
-
-/***************************** END STOLEN FROM PANGO *****************************/
-
 static char *
 sys_font_to_pango_font (XpThemeClass klazz, XpThemeFont type, char *buf,
 			size_t bufsiz)
 {
-  HDC hDC;
-  HWND hwnd;
-  LOGFONT lf;
-  int pt_size;
-  const char *weight;
-  const char *style;
-  char *font;
+  LOGFONTW lf;
 
   if (get_system_font (klazz, type, &lf))
     {
-      switch (lf.lfWeight)
-	{
-	case FW_THIN:
-	case FW_EXTRALIGHT:
-	  weight = "Ultra-Light";
-	  break;
+      PangoFontDescription *desc;
+      int pt_size;
+      const char *font;
 
-	case FW_LIGHT:
-	  weight = "Light";
-	  break;
+      desc = pango_win32_font_description_from_logfontw (&lf);
+      if (!desc)
+	{
+	  pango_font_description_free (desc);
+	  return NULL;
+	}
 
-	case FW_BOLD:
-	  weight = "Bold";
-	  break;
+      font = pango_font_description_to_string (desc);
+      pt_size = pango_font_description_get_size (desc);
 
-	case FW_SEMIBOLD:
-	  weight = "Semi-Bold";
-	  break;
+      if (!(font && *font))
+	return NULL;
 
-	case FW_ULTRABOLD:
-	  weight = "Ultra-Bold";
-	  break;
+      if (pt_size == 0)
+	{
+	  HDC hDC;
+	  HWND hwnd;
 
-	case FW_HEAVY:
-	  weight = "Heavy";
-	  break;
+	  hwnd = GetDesktopWindow ();
+	  hDC = GetDC (hwnd);
 
-	default:
-	  weight = "";
-	  break;
-	}
+	  if (hDC)
+	    pt_size = -MulDiv (lf.lfHeight, 72, GetDeviceCaps (hDC, LOGPIXELSY));
+	  else
+	    pt_size = 10;
 
-      if (lf.lfItalic)
-	style = "Italic";
-      else
-	style = "";
+	  if (hDC)
+	    ReleaseDC (hwnd, hDC);
 
-      hwnd = GetDesktopWindow ();
-      hDC = GetDC (hwnd);
-      if (hDC)
-	{
-	  pt_size = -MulDiv (lf.lfHeight, 72,
-			     GetDeviceCaps (hDC, LOGPIXELSY));
+	  g_snprintf (buf, bufsiz, "%s %d", font, pt_size);
 	}
       else
 	{
-	  pt_size = 10;
+	  g_snprintf (buf, bufsiz, "%s", font);
 	}
 
-      font = get_family_name (&lf, hDC);
-
-      if (hDC)
-	ReleaseDC (hwnd, hDC);
-
-      if (!(font && *font))
-	return NULL;
-
-      g_snprintf (buf, bufsiz, "%s %s %s %d", font, style, weight, pt_size);
-      g_free (font);
+      if (desc)
+	pango_font_description_free (desc);
 
       return buf;
     }
@@ -562,7 +307,6 @@ static void
 setup_menu_settings (GtkSettings *settings)
 {
   int menu_delay;
-  OSVERSIONINFOEX osvi;
   GObjectClass *klazz = G_OBJECT_GET_CLASS (G_OBJECT (settings));
 
   if (get_windows_version () > WIN95_VERSION)
@@ -2261,8 +2005,6 @@ draw_box (GtkStyle *style,
     }
   else if (detail && !strcmp (detail, "notebook") && GTK_IS_NOTEBOOK (widget))
     {
-      GtkNotebook *notebook = GTK_NOTEBOOK (widget);
-
       if (xp_theme_draw (window, XP_THEME_ELEMENT_TAB_PANE, style,
 			 x, y, width, height, state_type, area))
 	{
@@ -3161,8 +2903,21 @@ draw_hline (GtkStyle *style,
 {
   if (xp_theme_is_active () && detail && !strcmp (detail, "menuitem"))
     {
+      gint cx, cy;
+      gint new_y, new_height;
+      gint y_offset;
+
+      xp_theme_get_element_dimensions (XP_THEME_ELEMENT_MENU_SEPARATOR,
+				       state_type,
+				       &cx, &cy);
+
+      /* Center the separator */
+      y_offset = (area->height / 2) - (cy / 2);
+      new_y = y_offset >= 0 ? area->y + y_offset : area->y;
+      new_height = cy;
+
       if (xp_theme_draw
-	  (window, XP_THEME_ELEMENT_MENU_SEPARATOR, style, x1, y, x2, 1,
+	  (window, XP_THEME_ELEMENT_MENU_SEPARATOR, style, x1, new_y, x2, new_height,
 	   state_type, area))
 	{
 	  return;
diff -uprN gtk+-2.20.1/modules/engines/ms-windows/xp_theme.c gtk+-2.20.1.az/modules/engines/ms-windows/xp_theme.c
--- gtk+-2.20.1/modules/engines/ms-windows/xp_theme.c	2010-07-23 14:42:54 +0200
+++ gtk+-2.20.1.az/modules/engines/ms-windows/xp_theme.c	2010-07-23 14:36:02 +0200
@@ -31,6 +31,8 @@
 #include <string.h>
 #include <stdio.h>
 
+#include <uxtheme.h>
+
 #ifdef BUILDING_STANDALONE
 #include "gdk/gdkwin32.h"
 #else
@@ -86,6 +88,7 @@
 #define MBI_DISABLEDHOT    5
 #define MBI_DISABLEDPUSHED 6
 
+#define MENU_POPUPGUTTER    13
 #define MENU_POPUPITEM      14
 #define MENU_POPUPSEPARATOR 15
 
@@ -188,6 +191,13 @@ typedef BOOL (FAR PASCAL *IsThemeBackgro
 typedef HRESULT (FAR PASCAL *DrawThemeParentBackgroundFunc) (HWND hwnd,
 							     HDC hdc,
 							     RECT *prc);
+typedef HRESULT (FAR PASCAL *GetThemePartSizeFunc)          (HTHEME hTheme,
+							     HDC hdc,
+							     int iPartId,
+							     int iStateId,
+							     RECT *prc,
+							     THEME_SIZE eSize,
+							     SIZE *psz);
 
 static GetThemeSysFontFunc get_theme_sys_font_func = NULL;
 static GetThemeSysColorFunc get_theme_sys_color_func = NULL;
@@ -200,6 +210,7 @@ static IsThemeActiveFunc is_theme_active
 static IsAppThemedFunc is_app_themed_func = NULL;
 static IsThemeBackgroundPartiallyTransparentFunc is_theme_partially_transparent_func = NULL;
 static DrawThemeParentBackgroundFunc draw_theme_parent_background_func = NULL;
+static GetThemePartSizeFunc get_theme_part_size_func = NULL;
 
 static void
 xp_theme_close_open_handles (void)
@@ -242,6 +253,7 @@ xp_theme_init (void)
       get_theme_sys_metric_func = (GetThemeSysSizeFunc) GetProcAddress (uxtheme_dll, "GetThemeSysSize");
       is_theme_partially_transparent_func = (IsThemeBackgroundPartiallyTransparentFunc) GetProcAddress (uxtheme_dll, "IsThemeBackgroundPartiallyTransparent");
       draw_theme_parent_background_func = (DrawThemeParentBackgroundFunc) GetProcAddress (uxtheme_dll, "DrawThemeParentBackground");
+      get_theme_part_size_func = (GetThemePartSizeFunc) GetProcAddress (uxtheme_dll, "GetThemePartSize");
     }
 
   if (is_app_themed_func && is_theme_active_func)
@@ -292,6 +304,7 @@ xp_theme_exit (void)
   get_theme_sys_metric_func = NULL;
   is_theme_partially_transparent_func = NULL;
   draw_theme_parent_background_func = NULL;
+  get_theme_part_size_func = NULL;
 }
 
 static HTHEME
@@ -782,8 +795,11 @@ xp_theme_map_gtk_state (XpThemeElement e
       ret = 1;
       break;
 
-    case XP_THEME_ELEMENT_MENU_ITEM:
     case XP_THEME_ELEMENT_MENU_SEPARATOR:
+      ret = TS_NORMAL;
+      break;
+
+    case XP_THEME_ELEMENT_MENU_ITEM:
       switch (state)
 	{
 	case GTK_STATE_SELECTED:
@@ -934,6 +950,10 @@ xp_theme_draw (GdkWindow *win, XpThemeEl
 
   part_state = xp_theme_map_gtk_state (element, state_type);
 
+  /* Support transparency */
+  if (is_theme_partially_transparent_func (theme, element_part_map[element], part_state))
+    draw_theme_parent_background_func (GDK_WINDOW_HWND (win), dc, pClip);
+
   draw_theme_background_func (theme, dc, element_part_map[element],
 			      part_state, &rect, pClip);
 
@@ -958,6 +978,55 @@ xp_theme_is_drawable (XpThemeElement ele
 }
 
 gboolean
+xp_theme_get_element_dimensions (XpThemeElement element,
+				 GtkStateType state_type,
+				 gint *cx, gint *cy)
+{
+  HTHEME theme;
+  SIZE part_size;
+  int part_state;
+
+  if (!xp_theme_is_active ())
+    return FALSE;
+
+  theme = xp_theme_get_handle_by_element (element);
+  if (!theme)
+    return FALSE;
+
+  part_state = xp_theme_map_gtk_state (element, state_type);
+
+  get_theme_part_size_func (theme,
+			    NULL,
+			    element_part_map[element],
+			    part_state,
+			    NULL,
+			    TS_MIN,
+			    &part_size);
+
+  *cx = part_size.cx;
+  *cy = part_size.cy;
+
+  if (element == XP_THEME_ELEMENT_MENU_ITEM ||
+      element == XP_THEME_ELEMENT_MENU_SEPARATOR)
+  {
+    SIZE gutter_size;
+
+    get_theme_part_size_func (theme,
+			      NULL,
+			      MENU_POPUPGUTTER,
+			      0,
+			      NULL,
+			      TS_MIN,
+			      &gutter_size);
+
+	*cx += gutter_size.cx * 2;
+	*cy += gutter_size.cy * 2;
+  }
+
+  return TRUE;
+}
+
+gboolean
 xp_theme_get_system_font (XpThemeClass klazz, XpThemeFont fontId,
 			  OUT LOGFONTW *lf)
 {
diff -uprN gtk+-2.20.1/modules/engines/ms-windows/xp_theme.h gtk+-2.20.1.az/modules/engines/ms-windows/xp_theme.h
--- gtk+-2.20.1/modules/engines/ms-windows/xp_theme.h	2010-07-23 14:42:54 +0200
+++ gtk+-2.20.1.az/modules/engines/ms-windows/xp_theme.h	2010-07-23 14:11:37 +0200
@@ -141,6 +141,9 @@ gboolean xp_theme_draw (GdkWindow *win,
                         int height, GtkStateType state_type,
                         GdkRectangle *area);
 gboolean xp_theme_is_drawable (XpThemeElement element);
+gboolean xp_theme_get_element_dimensions (XpThemeElement element,
+                                          GtkStateType state_type,
+                                          gint *cx, gint *cy);
 gboolean xp_theme_get_system_font (XpThemeClass klazz, XpThemeFont fontId, OUT LOGFONTW *lf);
 gboolean xp_theme_get_system_color (XpThemeClass klazz, int colorId, OUT DWORD *pColor);
 gboolean xp_theme_get_system_metric (XpThemeClass klazz, int metricId, OUT int *pVal);
