Index: gtk/gtkviewport.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkviewport.c,v
retrieving revision 1.63
diff -u -p -r1.63 gtkviewport.c
--- gtk/gtkviewport.c	8 Jun 2003 15:34:30 -0000	1.63
+++ gtk/gtkviewport.c	7 Jul 2003 22:49:45 -0000
@@ -382,9 +382,11 @@ viewport_set_hadjustment_values (GtkView
   GtkBin *bin = GTK_BIN (viewport);
   GtkAllocation view_allocation;
   GtkAdjustment *hadjustment = gtk_viewport_get_hadjustment (viewport);
-
+  gdouble old_page_size;
+  
   viewport_get_view_allocation (viewport, &view_allocation);  
 
+  old_page_size = hadjustment->page_size;
   hadjustment->page_size = view_allocation.width;
   hadjustment->step_increment = view_allocation.width * 0.1;
   hadjustment->page_increment = view_allocation.width * 0.9;
@@ -401,7 +403,15 @@ viewport_set_hadjustment_values (GtkView
   else
     hadjustment->upper = view_allocation.width;
 
-  viewport_reclamp_adjustment (hadjustment, value_changed);
+  if (gtk_widget_get_direction (GTK_WIDGET (viewport)) == GTK_TEXT_DIR_RTL) 
+    {
+      gdouble old_value = hadjustment->value;
+      hadjustment->value = hadjustment->value + old_page_size - hadjustment->page_size;
+      viewport_reclamp_adjustment (hadjustment, value_changed);
+      *value_changed = (old_value != hadjustment->value);
+    }
+  else
+    viewport_reclamp_adjustment (hadjustment, value_changed);
 }
 
 static void
