--- gtk/gtkstatusicon.c	2012-03-18 17:44:22.000000000 -0300
+++ gtk/gtkstatusicon.c	2012-05-13 22:39:01.144236170 -0300
@@ -1314,7 +1314,7 @@
   GdkScreen *screen;
   GtkSettings *settings;
   GtkIconSize s;
-  gint w, h, d, dist, size;
+  gint w, h, dw, dh, d, dist, size;
 
   screen = gtk_widget_get_screen (widget);
 
@@ -1328,10 +1328,11 @@
 
   for (s = GTK_ICON_SIZE_MENU; s <= GTK_ICON_SIZE_DIALOG; s++)
     {
-      if (gtk_icon_size_lookup_for_settings (settings, s, &w, &h) &&
-	  w <= pixel_size && h <= pixel_size)
+      if (gtk_icon_size_lookup_for_settings (settings, s, &w, &h))
 	{
-	  d = MAX (pixel_size - w, pixel_size - h);
+          dw = w > pixel_size ? w - pixel_size : pixel_size - w;
+          dh = h > pixel_size ? h - pixel_size : pixel_size - h;
+	  d = MAX (dw, dh);
 	  if (d < dist)
 	    {
 	      dist = d;
