--- libwnck-2.4.0.1/libwnck/tasklist.c	2003-07-17 16:17:50.000000000 -0400
+++ libwnck-2.4.0.1-del1/libwnck/tasklist.c	2003-10-26 09:25:22.000000000 -0500
@@ -127,7 +127,8 @@
   WnckTask *active_app; /* NULL if active window not in tasklist */
   
   gboolean include_all_workspaces;
-  
+  gboolean window_list_or_buttons_size;
+ 
   /* Calculated by update_lists */
   GList *windows;
   GList *applications;
@@ -159,6 +160,12 @@
   gint minimum_width;
   gint minimum_height;
 
+  gint minimum_buttons_width;
+  gint minimum_buttons_height;
+
+  gint maximum_buttons_width;
+  gint maximum_buttons_height;
+
   WnckLoadIconFunction icon_loader;
   void *icon_loader_data;
   GDestroyNotify free_icon_loader_data;
@@ -213,7 +220,8 @@
 					     int             max_height,
 					     int             n_buttons,
 					     int            *n_cols_out,
-					     int            *n_rows_out);
+					     int            *n_rows_out,
+					     WnckTasklist   *tasklist);
 
 static void     wnck_tasklist_active_window_changed    (WnckScreen   *screen,
 							WnckTasklist *tasklist);
@@ -552,6 +560,22 @@
 }
 
 void
+wnck_tasklist_set_window_list_or_buttons_size (WnckTasklist *tasklist,
+					       gboolean      window_list_or_buttons_size)
+{
+  g_return_if_fail (WNCK_IS_TASKLIST (tasklist));
+
+  window_list_or_buttons_size = (window_list_or_buttons_size != 0);
+
+  if (tasklist->priv->window_list_or_buttons_size == window_list_or_buttons_size)
+    return;
+  
+  tasklist->priv->window_list_or_buttons_size = window_list_or_buttons_size;
+  wnck_tasklist_update_lists (tasklist);
+  gtk_widget_queue_resize (GTK_WIDGET (tasklist));
+}
+
+void
 wnck_tasklist_set_grouping_limit (WnckTasklist *tasklist,
 				  gint          limit)
 {
@@ -613,6 +637,104 @@
 	
   return tasklist->priv->minimum_height;
 }
+/* set the minimum buttons width 
+ * use -1 to unset it (resulting in the default width */
+void 
+wnck_tasklist_set_minimum_buttons_width (WnckTasklist *tasklist, gint size)
+{
+  g_return_if_fail (WNCK_IS_TASKLIST (tasklist));
+
+  if (size == -1) size = DEFAULT_WIDTH;
+
+  if (tasklist->priv->minimum_buttons_width == size)
+    return;
+
+  tasklist->priv->minimum_buttons_width = size;
+  gtk_widget_queue_resize (GTK_WIDGET (tasklist));
+}
+ 
+/* get the minimum buttons width */
+gint
+wnck_tasklist_get_minimum_buttons_width (WnckTasklist *tasklist)
+{
+  g_return_val_if_fail (WNCK_IS_TASKLIST (tasklist), 0);
+	
+  return tasklist->priv->minimum_buttons_width;
+}
+
+/* set the minimum buttons height
+ * use -1 to unset it (resulting in the default height */
+void 
+wnck_tasklist_set_minimum_buttons_height (WnckTasklist *tasklist, gint size)
+{
+  g_return_if_fail (WNCK_IS_TASKLIST (tasklist));
+
+  if (size == -1) size = DEFAULT_HEIGHT;
+
+  if (tasklist->priv->minimum_buttons_height == size)
+    return;
+
+  tasklist->priv->minimum_buttons_height = size;
+  gtk_widget_queue_resize (GTK_WIDGET (tasklist));
+}
+ 
+/* get the minimum buttons height */
+gint
+wnck_tasklist_get_minimum_buttons_height (WnckTasklist *tasklist)
+{
+  g_return_val_if_fail (WNCK_IS_TASKLIST (tasklist), 0);
+	
+  return tasklist->priv->minimum_buttons_height;
+}
+/* set the maximum buttons width 
+ * use -1 to unset it (resulting in the default width */
+void 
+wnck_tasklist_set_maximum_buttons_width (WnckTasklist *tasklist, gint size)
+{
+  g_return_if_fail (WNCK_IS_TASKLIST (tasklist));
+
+  if (size == -1) size = DEFAULT_WIDTH;
+
+  if (tasklist->priv->maximum_buttons_width == size)
+    return;
+
+  tasklist->priv->maximum_buttons_width = size;
+  gtk_widget_queue_resize (GTK_WIDGET (tasklist));
+}
+ 
+/* get the maximum buttons width */
+gint
+wnck_tasklist_get_maximum_buttons_width (WnckTasklist *tasklist)
+{
+  g_return_val_if_fail (WNCK_IS_TASKLIST (tasklist), 0);
+	
+  return tasklist->priv->maximum_buttons_width;
+}
+
+/* set the maximum buttons height
+ * use -1 to unset it (resulting in the default height */
+void 
+wnck_tasklist_set_maximum_buttons_height (WnckTasklist *tasklist, gint size)
+{
+  g_return_if_fail (WNCK_IS_TASKLIST (tasklist));
+
+  if (size == -1) size = DEFAULT_HEIGHT;
+
+  if (tasklist->priv->maximum_buttons_height == size)
+    return;
+
+  tasklist->priv->maximum_buttons_height = size;
+  gtk_widget_queue_resize (GTK_WIDGET (tasklist));
+}
+ 
+/* get the maximum buttons height */
+gint
+wnck_tasklist_get_maximum_buttons_height (WnckTasklist *tasklist)
+{
+  g_return_val_if_fail (WNCK_IS_TASKLIST (tasklist), 0);
+	
+  return tasklist->priv->maximum_buttons_height;
+}
 
 /**
  * wnck_tasklist_set_icon_loader:
@@ -650,25 +772,48 @@
 		      int            max_height,
 		      int            n_buttons,
 		      int           *n_cols_out,
-		      int           *n_rows_out)
+		      int           *n_rows_out,
+		      WnckTasklist  *tasklist)
 {
   int n_cols, n_rows;
+  int buttons_width;
 
-  /* How many rows fit in the allocation */
-  n_rows = allocation->height / max_height;
-
-  /* Don't have more rows than buttons */
-  n_rows = MIN (n_rows, n_buttons);
-
-  /* At least one row */
-  n_rows = MAX (n_rows, 1);
-  
-  /* We want to use as many rows as possible to limit the width */
-  n_cols = (n_buttons + n_rows - 1) / n_rows;
-
-  /* At least one column */
-  n_cols = MAX (n_cols, 1);
-
+  if (tasklist->priv->window_list_or_buttons_size)
+  {
+    /* How many rows fit in the allocation */
+    n_rows = allocation->height / max_height;
+ 
+    /* Don't have more rows than buttons */
+    n_rows = MIN (n_rows, n_buttons);
+ 
+    /* At least one row */
+    n_rows = MAX (n_rows, 1);
+    
+    /* We want to use as many rows as possible to limit the width */
+    /* Well, not true in max buttons size case */
+    n_cols = (n_buttons + n_rows - 1) / n_rows;
+ 
+    /* At least one column */
+    n_cols = MAX (n_cols, 1);
+  }
+  else
+  {
+    n_rows = allocation->height / max_height;
+    n_rows = MIN (n_rows, n_buttons);
+    n_rows = MAX (n_rows, 1);
+
+    buttons_width = wnck_tasklist_get_maximum_buttons_width(tasklist);
+
+    if (allocation->width == 0)
+      n_cols = n_buttons;
+    else
+    {
+      buttons_width = MIN (wnck_tasklist_get_maximum_buttons_width(tasklist), (allocation->width * n_rows)/(n_buttons>0?n_buttons:1));
+      buttons_width = MAX (10, buttons_width);
+      n_cols = ( (allocation->width * n_rows) / buttons_width + n_rows - 1 ) / n_rows;
+    }
+    n_cols = MAX (n_cols, 1);
+  }
   *n_cols_out = n_cols;
   *n_rows_out = n_rows;
   
@@ -825,10 +970,18 @@
       
       l = l->next;
     }
-  
-  tasklist->priv->max_button_width = max_width;
-  tasklist->priv->max_button_height = max_height;
 
+//by del 
+//if we are in the fixed buttons size mode, we do not care about children's sizes 
+  if (tasklist->priv->window_list_or_buttons_size)
+  {
+    tasklist->priv->max_button_width = max_width;
+  }
+  else
+  {
+    tasklist->priv->max_button_width = tasklist->priv->maximum_buttons_width;
+  }
+  tasklist->priv->max_button_height = max_height;
 
   /* this snippet of code seems to want to allocate at least
    * four buttons' worth of height for the widget.  I think this isn't
@@ -850,7 +1003,10 @@
   requisition->width = MAX(requisition->width, tasklist->priv->minimum_width);
   requisition->height = MAX(requisition->height, tasklist->priv->minimum_height);
   */
-  requisition->width = tasklist->priv->minimum_width;
+  if (tasklist->priv->window_list_or_buttons_size)
+    requisition->width = tasklist->priv->minimum_width;
+  else
+    requisition->width = 0;
   requisition->height = tasklist->priv->minimum_height;
   
   fake_allocation.width = requisition->width;
@@ -870,11 +1026,12 @@
 			tasklist->priv->max_button_width);
   
   /* Try ungrouped mode */
+
   wnck_tasklist_layout (&fake_allocation,
 			tasklist->priv->max_button_width,
 			tasklist->priv->max_button_height,
 			n_windows + n_startup_sequences,
-			&n_cols, &n_rows);
+			&n_cols, &n_rows, tasklist);
 
   last_n_cols = G_MAXINT;
   lowest_range = G_MAXINT;
@@ -906,7 +1063,7 @@
 			    tasklist->priv->max_button_width,
 			    tasklist->priv->max_button_height,
 			    n_startup_sequences + n_windows - n_grouped_buttons,
-			    &n_cols, &n_rows);
+			    &n_cols, &n_rows, tasklist);
       if (n_cols != last_n_cols &&
 	  (tasklist->priv->grouping == WNCK_TASKLIST_AUTO_GROUP ||
 	   ungrouped_apps == NULL))
@@ -991,12 +1148,14 @@
   grouping_limit = MIN (tasklist->priv->grouping_limit,
 			tasklist->priv->max_button_width);
 
+
+
   /* Try ungrouped mode */
   button_width = wnck_tasklist_layout (allocation,
 				       tasklist->priv->max_button_width,
 				       tasklist->priv->max_button_height,
 				       n_startup_sequences + n_windows,
-				       &n_cols, &n_rows);
+				       &n_cols, &n_rows, tasklist);
   while (ungrouped_apps != NULL &&
 	 ((tasklist->priv->grouping == WNCK_TASKLIST_ALWAYS_GROUP) ||
 	  ((tasklist->priv->grouping == WNCK_TASKLIST_AUTO_GROUP) &&
@@ -1036,7 +1195,7 @@
 					   tasklist->priv->max_button_width,
 					   tasklist->priv->max_button_height,
 					   n_startup_sequences + n_windows - n_grouped_buttons,
-					   &n_cols, &n_rows);
+					   &n_cols, &n_rows, tasklist);
     }
 
   /* Add all ungrouped windows to visible_tasks, and hide their apps */
