--- gtk+-2.2.1.orig/gtk/gtkrange.c	2003-04-15 22:24:34.000000000 +0100
+++ gtk+-2.2.1/gtk/gtkrange.c	2003-04-16 00:25:35.000000000 +0100
@@ -342,6 +342,14 @@
 							     G_MAXINT,
 							     0,
 							     G_PARAM_READABLE));
+  gtk_widget_class_install_style_property (widget_class,
+					   g_param_spec_int ("stepper_click_riscos",
+							     _("Stepper click RISC OS style"),
+							     _("Does right-click step in the reverse direction?"),
+							     0,
+							     1,
+							     0,
+							     G_PARAM_READABLE));
 }
 
 static void
@@ -1080,6 +1088,12 @@
 static GtkScrollType
 range_get_scroll_for_grab (GtkRange      *range)
 {  
+  GtkWidget *widget =  GTK_WIDGET (range);
+  gint reverse;
+  gtk_widget_style_get (widget,
+			"stepper_click_riscos", &reverse,
+                        NULL);
+
   switch (range->layout->grab_location)
     {
       /* Backward stepper */
@@ -1094,7 +1108,7 @@
           return GTK_SCROLL_PAGE_BACKWARD;
           break;
         case 3:
-          return GTK_SCROLL_START;
+          return reverse ? GTK_SCROLL_STEP_FORWARD : GTK_SCROLL_START;
           break;
         }
       break;
@@ -1111,18 +1125,22 @@
           return GTK_SCROLL_PAGE_FORWARD;
           break;
         case 3:
-          return GTK_SCROLL_END;
+          return reverse ? GTK_SCROLL_STEP_BACKWARD : GTK_SCROLL_END;
           break;
        }
       break;
 
       /* In the trough */
     case MOUSE_TROUGH:
-      {
-        if (range->trough_click_forward)
-	  return GTK_SCROLL_PAGE_FORWARD;
-        else
-	  return GTK_SCROLL_PAGE_BACKWARD;
+      switch (range->layout->grab_button)
+        {
+        case 1:
+          return range->trough_click_forward ? GTK_SCROLL_PAGE_FORWARD : GTK_SCROLL_PAGE_BACKWARD;
+        /* button 2 isn't handled by this function */
+        case 3:
+          if (reverse)
+            return range->trough_click_forward ? GTK_SCROLL_PAGE_BACKWARD : GTK_SCROLL_PAGE_FORWARD;
+          return range->trough_click_forward ? GTK_SCROLL_END : GTK_SCROLL_START;
       }
       break;
 
@@ -1183,10 +1201,13 @@
     gtk_widget_queue_draw (widget);
     
   if (range->layout->mouse_location == MOUSE_TROUGH  &&
-      event->button == 1)
+      (event->button == 1 || event->button == 3))
     {
       /* button 1 steps by page increment, as with button 2 on a stepper
        */
+      /* button 3 moves to top or bottom unless RISC OS scrolling is
+       * configured, when it's like button 1 but in the reverse direction
+       */
       GtkScrollType scroll;
       gdouble click_value;
       
