diff -r -u libwnck-2.6.0.1/libwnck/tasklist.c libwnck-2.6.0.1-new/libwnck/tasklist.c
--- libwnck-2.6.0.1/libwnck/tasklist.c	2004-10-18 21:37:33.918914463 -0400
+++ libwnck-2.6.0.1-new/libwnck/tasklist.c	2004-10-18 21:37:20.623505496 -0400
@@ -85,6 +89,9 @@
 
   WnckTaskType type;
 
+  gchar *title;
+  int saved_width;
+
   WnckClassGroup *class_group;
   WnckWindow *window;
 #ifdef HAVE_STARTUP_NOTIFICATION
@@ -1948,6 +1918,195 @@
     }
 }
 
+
+#define ELLIPSIS "..."
+#define ELLIPSE_BUTTON_SPACING MINI_ICON_SIZE + 14 /* Leave room for padding */
+
+/* Caution: this is an _expensive_ function */
+static int
+measure_string_width (const char  *string,
+		      PangoLayout *layout)
+{
+	int width;
+	
+	pango_layout_set_text (layout, string, -1);
+	pango_layout_get_pixel_size (layout, &width, NULL);
+
+	return width;
+}
+
+/* this is also plenty slow */
+static void
+compute_character_widths (const char    *string,
+			  PangoLayout   *layout,
+			  int           *char_len_return,
+			  int          **widths_return,
+			  int          **cuts_return)
+{
+	int *widths;
+	int *offsets;
+	int *cuts;
+	int char_len;
+	int byte_len;
+	const char *p;
+	int i;
+	PangoLayoutIter *iter;
+	PangoLogAttr *attrs;
+	
+#define BEGINS_UTF8_CHAR(x) (((x) & 0xc0) != 0x80)
+	
+	char_len = g_utf8_strlen (string, -1);
+	byte_len = strlen (string);
+	
+	widths = g_new (int, char_len);
+	offsets = g_new (int, byte_len);
+
+	/* Create a translation table from byte index to char offset */
+	p = string;
+	i = 0;
+	while (*p) {
+		int byte_index = p - string;
+		
+		if (BEGINS_UTF8_CHAR (*p)) {
+			offsets[byte_index] = i;
+			++i;
+		} else {
+			offsets[byte_index] = G_MAXINT; /* segv if we try to use this */
+		}
+		
+		++p;
+	}
+
+	/* Now fill in the widths array */
+	pango_layout_set_text (layout, string, -1);
+	
+	iter = pango_layout_get_iter (layout);
+
+	do {
+		PangoRectangle extents;
+		int byte_index;
+
+		byte_index = pango_layout_iter_get_index (iter);
+
+		if (byte_index < byte_len) {
+			pango_layout_iter_get_char_extents (iter, &extents);
+			
+			g_assert (BEGINS_UTF8_CHAR (string[byte_index]));
+			g_assert (offsets[byte_index] < char_len);
+			
+			widths[offsets[byte_index]] = PANGO_PIXELS (extents.width);
+		}
+		
+	} while (pango_layout_iter_next_char (iter));
+
+	pango_layout_iter_free (iter);
+
+	g_free (offsets);
+	
+	*widths_return = widths;
+
+	/* Now compute character offsets that are legitimate places to
+	 * chop the string
+	 */
+	attrs = g_new (PangoLogAttr, char_len + 1);
+	
+	pango_get_log_attrs (string, byte_len, -1,
+			     pango_context_get_language (
+				     pango_layout_get_context (layout)),
+			     attrs,
+			     char_len + 1);
+
+	cuts = g_new (int, char_len);
+	i = 0;
+	while (i < char_len) {
+		cuts[i] = attrs[i].is_cursor_position;
+
+		++i;
+	}
+
+	g_free (attrs);
+
+	*cuts_return = cuts;
+
+	*char_len_return = char_len;
+}
+
+
+/* Taken from Eel */
+static char *
+string_ellipsize_end (const char *string, PangoLayout *layout, int width)
+{
+	int resulting_width;
+	int *cuts;
+	int *widths;
+	int char_len;
+	const char *p;
+	int truncate_offset;
+	char *result;
+	
+	/* See explanatory comments in ellipsize_start */
+	
+	if (*string == '\0')
+		return g_strdup ("");
+
+	resulting_width = measure_string_width (string, layout);
+	
+	if (resulting_width <= width) {
+		return g_strdup (string);
+	}
+
+	width -= measure_string_width (ELLIPSIS, layout);
+
+	if (width < 0) {
+		return g_strdup ("");
+	}
+	
+	compute_character_widths (string, layout, &char_len, &widths, &cuts);
+	
+        for (truncate_offset = char_len - 1; truncate_offset > 0; truncate_offset--) {
+        	resulting_width -= widths[truncate_offset];
+        	if (resulting_width <= width &&
+		    cuts[truncate_offset]) {
+			break;
+        	}
+        }
+
+	g_free (cuts);
+	g_free (widths);
+
+	p = g_utf8_offset_to_pointer (string, truncate_offset);
+	
+	result = g_malloc ((p - string) + strlen (ELLIPSIS) + 1);
+	memcpy (result, string, (p - string));
+	strcpy (result + (p - string), ELLIPSIS);
+
+	return result;
+}
+
+
+static gboolean
+wnck_task_button_resize (GtkWidget *button, GtkAllocation *allocation, gpointer data)
+{
+  WnckTask *task = (WnckTask *) data;
+
+  PangoLayout *layout;
+  
+  if (!button) return TRUE;
+  if (!task->title) return TRUE;
+  if (!task) return TRUE;
+  if (!task->label) return TRUE;
+
+  layout = gtk_widget_create_pango_layout (task->button, NULL);
+
+  if (button->allocation.width == task->saved_width) return TRUE;
+  
+  gtk_label_set_text (GTK_LABEL (task->label), string_ellipsize_end (task->title, layout, button->allocation.width - ELLIPSE_BUTTON_SPACING));
+
+  task->saved_width = allocation->width;
+
+  return TRUE;
+}
+
 static char *
 wnck_task_get_text (WnckTask *task)
 {
@@ -2138,6 +2297,7 @@
 {
   GdkPixbuf *pixbuf;
   char *text;
+  PangoLayout *layout;
 
   pixbuf = wnck_task_get_icon (task);
   gtk_image_set_from_pixbuf (GTK_IMAGE (task->image),
@@ -2148,7 +2308,9 @@
   text = wnck_task_get_text (task);
   if (text != NULL)
     {
-      gtk_label_set_text (GTK_LABEL (task->label), text);
+      task->title = g_strdup (text);
+      layout = gtk_widget_create_pango_layout (task->button, NULL);
+      gtk_label_set_text (GTK_LABEL (task->label), string_ellipsize_end (task->title, layout, task->button->allocation.width - ELLIPSE_BUTTON_SPACING));
       gtk_tooltips_set_tip (task->tasklist->priv->tooltips, task->button, text, NULL);
       g_free (text);
     }
@@ -2375,6 +2537,8 @@
   gtk_widget_show (task->image);
 
   text = wnck_task_get_text (task);
+  task->title = g_strdup (text);
+  task->saved_width = 0;
   task->label = gtk_label_new (text);
   gtk_widget_show (task->label);
 
@@ -2420,6 +2584,12 @@
                            G_OBJECT (task),
                            0);
 
+  g_signal_connect_object (G_OBJECT(task->button), "size_allocate",
+			   G_CALLBACK (wnck_task_button_resize),
+			   G_OBJECT (task),
+			   0);
+
+
   switch (task->type)
     {
     case WNCK_TASK_CLASS_GROUP:
