--- panel-toplevel.c.orig	2009-07-01 15:06:23.000000000 +0200
+++ panel-toplevel.c	2009-08-13 10:54:41.882470107 +0200
@@ -1373,6 +1373,22 @@
 	return (size <= 0) ? DEFAULT_AUTO_HIDE_SIZE : size;
 }
 
+static inline int
+panel_toplevel_get_effective_auto_hide_size_strut (PanelToplevel *toplevel)
+{
+	int size;
+
+	if (toplevel->priv->orientation & PANEL_HORIZONTAL_MASK)
+		size = CLAMP (toplevel->priv->auto_hide_size,
+			      0, toplevel->priv->original_height / 2);
+	else
+		size = CLAMP (toplevel->priv->auto_hide_size,
+			      0, toplevel->priv->original_width / 2);
+
+	/* paranoia */
+	return (size < 0) ? DEFAULT_AUTO_HIDE_SIZE : size;
+}
+
 static gboolean
 panel_toplevel_update_struts (PanelToplevel *toplevel, gboolean end_of_animation)
 {
@@ -1471,7 +1487,7 @@
 	}
 
 	if (toplevel->priv->auto_hide && strut > 0)
-		strut = panel_toplevel_get_effective_auto_hide_size (toplevel);
+		strut = panel_toplevel_get_effective_auto_hide_size_strut (toplevel);
 
 	if (strut > 0)
 		geometry_changed = panel_struts_register_strut (toplevel,
