Index: gtk/gtktoolbar.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktoolbar.c,v
retrieving revision 1.78
diff -u -b -B -p -r1.78 gtktoolbar.c
--- gtk/gtktoolbar.c	22 Oct 2002 21:05:47 -0000	1.78
+++ gtk/gtktoolbar.c	24 Oct 2002 23:07:56 -0000
@@ -712,6 +712,8 @@ gtk_toolbar_size_allocate (GtkWidget    
   gint x_border_width, y_border_width;
   gint space_size;
   gint ipadding;
+  GtkTextDirection direction;
+  gint ltr_x;
   
   g_return_if_fail (GTK_IS_TOOLBAR (widget));
   g_return_if_fail (allocation != NULL);
@@ -719,6 +721,8 @@ gtk_toolbar_size_allocate (GtkWidget    
   toolbar = GTK_TOOLBAR (widget);
   widget->allocation = *allocation;
   
+  direction = gtk_widget_get_direction (widget);
+
   x_border_width = GTK_CONTAINER (toolbar)->border_width;
   y_border_width = GTK_CONTAINER (toolbar)->border_width;
 
@@ -746,6 +750,9 @@ gtk_toolbar_size_allocate (GtkWidget    
 
 	  if (toolbar->orientation == GTK_ORIENTATION_HORIZONTAL)
 	    {
+	      if (direction == GTK_TEXT_DIR_RTL)
+		child_space->alloc_x = allocation->width - alloc.x - space_size;
+	      else
 	      child_space->alloc_x = alloc.x;
 	      child_space->alloc_y = allocation->y + (allocation->height - toolbar->button_maxh) / 2;
 	      alloc.x += space_size;
@@ -768,15 +775,19 @@ gtk_toolbar_size_allocate (GtkWidget    
 	  alloc.width = toolbar->button_maxw;
 	  alloc.height = toolbar->button_maxh;
 
-	  if (toolbar->orientation == GTK_ORIENTATION_HORIZONTAL)
+	  ltr_x = alloc.x;
+	  if (toolbar->orientation == GTK_ORIENTATION_HORIZONTAL) {
+	    if (direction == GTK_TEXT_DIR_RTL)
+	      alloc.x = allocation->width - alloc.x - alloc.width;
 	    alloc.y = allocation->y + (allocation->height - toolbar->button_maxh) / 2;
+	  }
 	  else
 	    alloc.x = allocation->x + (allocation->width - toolbar->button_maxw) / 2;
 
 	  gtk_widget_size_allocate (child->widget, &alloc);
 
 	  if (toolbar->orientation == GTK_ORIENTATION_HORIZONTAL)
-	    alloc.x += toolbar->button_maxw;
+	    alloc.x = ltr_x + toolbar->button_maxw;
 	  else
 	    alloc.y += toolbar->button_maxh;
 
@@ -791,15 +802,19 @@ gtk_toolbar_size_allocate (GtkWidget    
 	  alloc.width = child_requisition.width;
 	  alloc.height = child_requisition.height;
 
-	  if (toolbar->orientation == GTK_ORIENTATION_HORIZONTAL)
+	  ltr_x = alloc.x;
+	  if (toolbar->orientation == GTK_ORIENTATION_HORIZONTAL) {
+	    if (direction == GTK_TEXT_DIR_RTL)
+	      alloc.x = allocation->width - alloc.x - alloc.width;
 	    alloc.y = allocation->y + (allocation->height - child_requisition.height) / 2;
+	  }
 	  else
 	    alloc.x = allocation->x + (allocation->width - child_requisition.width) / 2;
 
 	  gtk_widget_size_allocate (child->widget, &alloc);
 
 	  if (toolbar->orientation == GTK_ORIENTATION_HORIZONTAL)
-	    alloc.x += child_requisition.width;
+	    alloc.x = ltr_x + child_requisition.width;
 	  else
 	    alloc.y += child_requisition.height;
 
