diff -ur gnome-panel-2.27.4-orig/gnome-panel/panel-toplevel.c gnome-panel-2.27.4/gnome-panel/panel-toplevel.c
--- gnome-panel-2.27.4-orig/gnome-panel/panel-toplevel.c	2009-08-13 21:14:34.493432253 +0200
+++ gnome-panel-2.27.4/gnome-panel/panel-toplevel.c	2009-08-14 08:18:56.903816500 +0200
@@ -2430,7 +2430,19 @@
 
 	if (!toplevel->priv->expand &&
 	    !toplevel->priv->buttons_enabled && !toplevel->priv->attached)
-		non_panel_widget_size = 2 * HANDLE_SIZE;
+		if (toplevel->priv->orientation & PANEL_HORIZONTAL_MASK) {
+			if (!toplevel->priv->x_centered && (toplevel->priv->x == 0 || toplevel->priv->x_right == 0)) {
+				non_panel_widget_size = HANDLE_SIZE;
+			} else {
+				non_panel_widget_size = 2 * HANDLE_SIZE;
+			}
+		} else {
+			if (!toplevel->priv->y_centered && (toplevel->priv->y == 0 || toplevel->priv->y_bottom == 0)) {
+				non_panel_widget_size = HANDLE_SIZE;
+			} else {
+				non_panel_widget_size = 2 * HANDLE_SIZE;
+			}
+		}
 	else
 		non_panel_widget_size = 0;
 
@@ -3082,15 +3094,15 @@
 		challoc = *allocation;
 	else {
 		if (toplevel->priv->orientation & PANEL_HORIZONTAL_MASK) {
-			challoc.x      = HANDLE_SIZE;
+			challoc.x      = (toplevel->priv->x == 0 && !toplevel->priv->x_centered) ? 0 : HANDLE_SIZE;
 			challoc.y      = 0;
-			challoc.width  = allocation->width - 2 * HANDLE_SIZE;
+			challoc.width  = allocation->width - ( ( !toplevel->priv->x_centered && ( toplevel->priv->x == 0 || toplevel->priv->x_right == 0 ) ) ? 1 : 2 ) * HANDLE_SIZE;
 			challoc.height = allocation->height;
 		} else {
 			challoc.x      = 0;
-			challoc.y      = HANDLE_SIZE;
+			challoc.y      = (toplevel->priv->y == 0 && !toplevel->priv->y_centered) ? 0 : HANDLE_SIZE;
 			challoc.width  = allocation->width;
-			challoc.height = allocation->height - 2 * HANDLE_SIZE;
+			challoc.height = allocation->height - ( ( !toplevel->priv->y_centered && ( toplevel->priv->y == 0 || toplevel->priv->y_bottom == 0 ) ) ? 1 : 2 ) * HANDLE_SIZE;
 		}
 	}
 
@@ -3167,23 +3179,27 @@
 		if (edges & PANEL_EDGE_LEFT)
 			x += xthickness;
 
-		gtk_paint_handle (widget->style, widget->window,
-				  GTK_WIDGET_STATE (widget),
-				  GTK_SHADOW_OUT,
-				  &event->area, widget, "handlebox",
-				  x, y, width, height,
-				  GTK_ORIENTATION_VERTICAL);
+		if (toplevel->priv->x != 0 || toplevel->priv->x_centered) {
+			gtk_paint_handle (widget->style, widget->window,
+					  GTK_WIDGET_STATE (widget),
+					  GTK_SHADOW_OUT,
+					  &event->area, widget, "handlebox",
+					  x, y, width, height,
+					  GTK_ORIENTATION_VERTICAL);
+		}
 
 		x = widget->allocation.width - HANDLE_SIZE;
 		if (edges & PANEL_EDGE_RIGHT)
 			x -= xthickness;
 
-		gtk_paint_handle (widget->style, widget->window,
-				  GTK_WIDGET_STATE (widget),
-				  GTK_SHADOW_OUT,
-				  &event->area, widget, "handlebox",
-				  x, y, width, height,
-				  GTK_ORIENTATION_VERTICAL);
+		if (toplevel->priv->x_right != 0 || toplevel->priv->x_centered) {
+			gtk_paint_handle (widget->style, widget->window,
+					  GTK_WIDGET_STATE (widget),
+					  GTK_SHADOW_OUT,
+					  &event->area, widget, "handlebox",
+					  x, y, width, height,
+					  GTK_ORIENTATION_VERTICAL);
+		}
 	} else {
 		int x, y, width, height;
 		int xthickness, ythickness;
@@ -3205,23 +3221,27 @@
 		if (edges & PANEL_EDGE_TOP)
 			y += ythickness;
 
-		gtk_paint_handle (widget->style, widget->window,
-				  GTK_WIDGET_STATE (widget),
-				  GTK_SHADOW_OUT,
-				  &event->area, widget, "handlebox",
-				  x, y, width, height,
-				  GTK_ORIENTATION_HORIZONTAL);
+		if (toplevel->priv->y != 0 || toplevel->priv->y_centered) {
+			gtk_paint_handle (widget->style, widget->window,
+					  GTK_WIDGET_STATE (widget),
+					  GTK_SHADOW_OUT,
+					  &event->area, widget, "handlebox",
+					  x, y, width, height,
+					  GTK_ORIENTATION_HORIZONTAL);
+		}
 
 		y = widget->allocation.height - HANDLE_SIZE;
 		if (edges & PANEL_EDGE_BOTTOM)
 			y -= ythickness;
 
-		gtk_paint_handle (widget->style, widget->window,
-				  GTK_WIDGET_STATE (widget),
-				  GTK_SHADOW_OUT,
-				  &event->area, widget, "handlebox",
-				  x, y, width, height,
-				  GTK_ORIENTATION_HORIZONTAL);
+		if (toplevel->priv->y_bottom != 0 || toplevel->priv->y_centered) {
+			gtk_paint_handle (widget->style, widget->window,
+					  GTK_WIDGET_STATE (widget),
+					  GTK_SHADOW_OUT,
+					  &event->area, widget, "handlebox",
+					  x, y, width, height,
+					  GTK_ORIENTATION_HORIZONTAL);
+		}
 	}
 
 	return retval;
