=== modified file 'gtk/gtklabel.c'
--- gtk/gtklabel.c	2006-08-17 12:00:36 +0000
+++ gtk/gtklabel.c	2006-08-19 22:49:11 +0000
@@ -177,7 +178,7 @@
 					     guint              time);
 
 
-/* For selectable lables: */
+/* For selectable labels: */
 static void gtk_label_move_cursor        (GtkLabel        *label,
 					  GtkMovementStep  step,
 					  gint             count,
@@ -2189,10 +2198,11 @@
 
   (* GTK_WIDGET_CLASS (gtk_label_parent_class)->size_allocate) (widget, allocation);
 
   if (label->ellipsize)
     {
       if (label->layout)
-	pango_layout_set_width (label->layout, allocation->width * PANGO_SCALE);
+	pango_layout_set_width (label->layout,
+				(allocation->width - label->misc.xpad * 2) * PANGO_SCALE);
     }
 
   if (label->select_info && label->select_info->window)
@@ -2266,21 +2276,20 @@
   else
     xalign = 1.0 - misc->xalign;
 
   if (label->ellipsize || priv->width_chars > 0)
     {
       int width;
 
       width = pango_layout_get_width (label->layout);
-      if (width == -1)
-	pango_layout_get_pixel_size (label->layout, &req_width, NULL);
-      else
-	req_width = PANGO_PIXELS (width);
+      pango_layout_get_pixel_size (label->layout, &req_width, NULL);
+      if (width != -1)
+	req_width = MIN(PANGO_PIXELS (width), req_width) + 2 * misc->xpad;
     }
   else
     req_width = widget->requisition.width;
 
   x = floor (widget->allocation.x + (gint)misc->xpad +
	      xalign * (widget->allocation.width - req_width));
 
   if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
     x = MAX (x, widget->allocation.x + misc->xpad);

