diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index 0774710..a2f50cd 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -378,6 +378,7 @@ gtk_private_h_sources =		\
 	gtkprintoperation-private.h\
 	gtkprintutils.h		\
 	gtkprivate.h		\
+	gtkrangeprivate.h       \
 	gtkrbtree.h		\
 	gtkrecentchooserdefault.h \
 	gtkrecentchooserprivate.h \
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index 7cd33c8..22d47bb 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -4195,3 +4195,32 @@ _gtk_range_set_steppers (GtkRange      *range,
   range->priv->has_stepper_c = has_c;
   range->priv->has_stepper_d = has_d;
 }
+
+void
+_gtk_range_get_internal_geometry (GtkRange     *range,
+                                  GdkRectangle *trough,
+                                  GdkRectangle *slider,
+                                  GdkRectangle *stepper_a,
+                                  GdkRectangle *stepper_b,
+                                  GdkRectangle *stepper_c,
+                                  GdkRectangle *stepper_d)
+{
+  if (trough)
+    *trough = range->priv->trough;
+
+  if (slider)
+    *slider = range->priv->slider;
+
+  if (stepper_a)
+    *stepper_a = range->priv->stepper_a;
+
+  if (stepper_b)
+    *stepper_b = range->priv->stepper_b;
+
+  if (stepper_c)
+    *stepper_c = range->priv->stepper_c;
+
+  if (stepper_c)
+    *stepper_c = range->priv->stepper_d;
+}
+
diff --git a/gtk/gtkrangeprivate.h b/gtk/gtkrangeprivate.h
new file mode 100644
index 0000000..086b93e
--- /dev/null
+++ b/gtk/gtkrangeprivate.h
@@ -0,0 +1,35 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/*
+ * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
+ * file for a list of people on the GTK+ Team.  See the ChangeLog
+ * files for a list of changes.  These files are distributed with
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __GTK_RANGE_PRIVATE_H__
+#define __GTK_RANGE_PRIVATE_H__
+void _gtk_range_get_internal_geometry (GtkRange     *range,
+                                       GdkRectangle *trough,
+                                       GdkRectangle *slider,
+                                       GdkRectangle *stepper_a,
+                                       GdkRectangle *stepper_b,
+                                       GdkRectangle *stepper_c,
+                                       GdkRectangle *stepper_d);
+#endif /* __GTK_RANGE_PRIVATE_H__ */
diff --git a/gtk/gtkscrollbar.c b/gtk/gtkscrollbar.c
index d04ed7c..16a4b35 100644
--- a/gtk/gtkscrollbar.c
+++ b/gtk/gtkscrollbar.c
@@ -1,6 +1,7 @@
 /* GTK - The GIMP Toolkit
  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
  * Copyright (C) 2001 Red Hat, Inc.
+ * Copyrigth (C) 2010 Alberto Ruiz <alberto.ruiz@codethink.co.uk>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -30,7 +31,8 @@
 #include "gtkscrollbar.h"
 #include "gtkintl.h"
 #include "gtkprivate.h"
-
+#include "gtkrangeprivate.h"
+#include "gtkorientable.h"  
 
 /**
  * SECTION:gtkscrollbar
@@ -55,9 +57,25 @@
  * example the <keycap>PageDown</keycap> key).
  */
 
+typedef struct _GtkScrollbarPrivate
+{
+  GList    *marks;
+  gboolean  grab_on_slider;
+} GtkScrollbarPrivate;
+
+#define GTK_SCROLLBAR_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_SCROLLBAR, GtkScrollbarPrivate))
 
-static void gtk_scrollbar_style_set (GtkWidget *widget,
-                                     GtkStyle  *previous);
+static void     gtk_scrollbar_style_set       (GtkWidget      *widget,
+                                               GtkStyle       *previous);
+static void     gtk_scrollbar_finalize       (GObject        *object);
+static gboolean gtk_scrollbar_draw         (GtkWidget      *widget,
+                                            cairo_t        *cr);
+static gint     gtk_scrollbar_button_press   (GtkWidget      *widget,
+                                              GdkEventButton *event);
+static gint     gtk_scrollbar_button_release (GtkWidget      *widget,
+                                              GdkEventButton *event);
+       void     gtk_scrollbar_clear_marks    (GtkScrollbar   *scrollbar);
+ 
 
 G_DEFINE_TYPE (GtkScrollbar, gtk_scrollbar, GTK_TYPE_RANGE)
 
@@ -65,8 +83,14 @@ static void
 gtk_scrollbar_class_init (GtkScrollbarClass *class)
 {
   GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
+  GObjectClass   *gobject_class = G_OBJECT_CLASS (class);
 
   widget_class->style_set = gtk_scrollbar_style_set;
+  widget_class->draw = gtk_scrollbar_draw;
+  widget_class->button_press_event = gtk_scrollbar_button_press;
+  widget_class->button_release_event = gtk_scrollbar_button_release;
+  gobject_class->finalize = gtk_scrollbar_finalize;
+
 
   GTK_RANGE_CLASS (class)->stepper_detail = "Xscrollbar";
 
@@ -113,11 +137,184 @@ gtk_scrollbar_class_init (GtkScrollbarClass *class)
                                                                  P_("Display a second forward arrow button on the opposite end of the scrollbar"),
                                                                  FALSE,
                                                                  GTK_PARAM_READABLE));
+                                                                 
+                                                                 
+  g_type_class_add_private (gobject_class, sizeof (GtkScrollbarPrivate));
+}
+
+static void
+paint_slider (GtkWidget      *widget,
+              cairo_t        *cr,
+              GdkRectangle   *slider,
+              GtkOrientation  orientation)
+{
+  GdkRectangle real_slider;
+  gint state, x, y;
+  gboolean touchscreen, hover, shadow_type;
+  GtkScrollbarPrivate *priv = GTK_SCROLLBAR_GET_PRIVATE (GTK_SCROLLBAR (widget));
+  
+  gtk_widget_get_allocation (widget, &real_slider);
+
+  real_slider.width = slider->width;
+  real_slider.height = slider->height;
+  real_slider.x += slider->x;
+  real_slider.y += slider->y;
+  
+  gtk_widget_get_pointer (widget, &x, &y);
+  hover = FALSE;
+
+  g_object_get (gtk_widget_get_settings (widget),
+                "gtk-touchscreen-mode", &touchscreen,
+                NULL);  
+  
+  if (x >= slider->x && x <= (slider->x + slider->width) &&
+      y >= slider->y && y <= (slider->y + slider->height))
+    hover = TRUE;
+  
+  if (!gtk_widget_is_sensitive (widget))
+    state = GTK_STATE_INSENSITIVE;
+  else if (!touchscreen && (hover || priv->grab_on_slider))
+    state = GTK_STATE_PRELIGHT;
+  else
+    state = GTK_STATE_NORMAL;
+
+  shadow_type = GTK_SHADOW_OUT;
+  
+  cairo_save (cr);
+  gtk_paint_slider (gtk_widget_get_style (widget),
+                    cr,
+                    state,
+                    shadow_type,
+                    widget,
+                    "slider",
+                    real_slider.x,
+                    real_slider.y,
+                    real_slider.width,
+                    real_slider.height,
+                    orientation);                      
+  cairo_restore (cr);
+}
+
+static gboolean
+gtk_scrollbar_draw (GtkWidget *widget, cairo_t *cr)
+{
+  GList *marks, *next;
+  GtkScrollbar  *scrollbar;
+  GtkStyle      *style;
+  GdkRectangle   slider, trough, mark_rect;
+  gint           orientation, state;
+  gchar         *detail;
+
+  scrollbar = (GtkScrollbar*)widget;
+  marks = GTK_SCROLLBAR_GET_PRIVATE (scrollbar)->marks;
+  orientation = gtk_orientable_get_orientation (GTK_ORIENTABLE (widget));
+  
+  GTK_WIDGET_CLASS (gtk_scrollbar_parent_class)->draw (widget, cr);
+
+  _gtk_range_get_internal_geometry (GTK_RANGE(widget), &trough, &slider,
+                                    NULL, NULL, NULL, NULL);
+
+  style = gtk_widget_get_style(widget);
+
+  if (!gtk_widget_is_sensitive (widget))
+    state = GTK_STATE_INSENSITIVE;
+  else
+    state = GTK_STATE_SELECTED;
+  next = marks;
+  while (next)
+  {
+    GdkRectangle real_mark;
+    gdouble *mark =  (gdouble*)next->data;
+
+    gtk_widget_get_allocation (widget, &real_mark);
+
+    if (orientation == GTK_ORIENTATION_VERTICAL)
+    {
+      mark_rect.x = slider.x;
+      mark_rect.y = trough.y +
+                    style->ythickness +
+                    (trough.height - (style->ythickness * 3)) *
+                    *mark;
+      mark_rect.width = slider.width;
+      mark_rect.height = style->ythickness;
+      detail = "scrollbar-vmarker";
+    }
+    else
+    {
+      mark_rect.x = trough.x +
+                    style->xthickness +
+                    (trough.width - (style->xthickness * 3)) *
+                    *mark;
+      mark_rect.y = slider.y;
+      mark_rect.width = style->xthickness;
+      mark_rect.height = slider.height;
+      detail = "scrollbar-hmarker";      
+    }
+    
+    real_mark.width = mark_rect.width;
+    real_mark.height = mark_rect.height;
+    real_mark.x += mark_rect.x;
+    real_mark.y += mark_rect.y;
+    
+    gtk_paint_flat_box (style,
+                        cr,
+                        state,
+                        GTK_SHADOW_NONE,
+                        widget,
+                        detail,
+                        real_mark.x,
+                        real_mark.y,
+                        real_mark.width,
+                        real_mark.height);
+
+    next = next->next;
+  }
+    
+  paint_slider (widget, cr, &slider, orientation);
+  
+  return FALSE;
+}
+
+static gint
+gtk_scrollbar_button_press (GtkWidget *widget, GdkEventButton *event)
+{
+  gint                 x, y;
+  GtkScrollbarPrivate *priv;
+  GdkRectangle         slider;
+  
+  GTK_WIDGET_CLASS (gtk_scrollbar_parent_class)->button_press_event (widget, event);
+  
+  priv = GTK_SCROLLBAR_GET_PRIVATE (GTK_SCROLLBAR (widget));
+  gtk_widget_get_pointer (widget, &x, &y);
+  _gtk_range_get_internal_geometry (GTK_RANGE(widget), NULL, &slider, NULL,
+                                    NULL, NULL, NULL);
+  
+  if (x >= slider.x && x <= (slider.x + slider.width) &&
+      y >= slider.y && y <= (slider.y + slider.height))
+    priv->grab_on_slider = TRUE;
+  
+  return FALSE;
+}
+
+static gint
+gtk_scrollbar_button_release (GtkWidget *widget, GdkEventButton *event)
+{
+  GtkScrollbarPrivate *priv;
+
+  GTK_WIDGET_CLASS (gtk_scrollbar_parent_class)->button_release_event (widget, event);
+  
+  priv = GTK_SCROLLBAR_GET_PRIVATE (GTK_SCROLLBAR (widget));
+  
+  priv->grab_on_slider = FALSE;
+  return FALSE;
 }
 
 static void
 gtk_scrollbar_init (GtkScrollbar *scrollbar)
 {
+  GtkScrollbarPrivate *priv = GTK_SCROLLBAR_GET_PRIVATE (scrollbar);
+  priv->marks = NULL;
+  priv->grab_on_slider = FALSE;
 }
 
 static void
@@ -169,3 +366,71 @@ gtk_scrollbar_new (GtkOrientation  orientation,
                        "adjustment",  adjustment,
                        NULL);
 }
+
+/**
+ * gtk_scrollbar_add_mark
+ * @scrollbar: a #GtkScrollbar
+ * @mark: a double with a value from 0.0 to 1.0 which represents a relative position along the trough
+ * 
+ * Sets a mark in the trough of the scrollbar to hint the location of a certain
+ * element in the area tha is being scrolled. This is useful for search or any
+ * other content matching in a text buffer.
+ * See gtk_scrollbar_clear_marks() for mark removal.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_scrollbar_add_mark (GtkScrollbar *scrollbar, gdouble mark)
+{
+  GtkScrollbarPrivate *priv;
+  gdouble *stored_mark;
+  GList *next;
+  
+  g_return_if_fail (mark >= 0.0 && mark <= 1.0);
+
+  priv = GTK_SCROLLBAR_GET_PRIVATE (scrollbar);
+
+  next = priv->marks;
+  while (next)
+  {
+    gdouble *stored_mark = next->data;
+    g_return_if_fail (*stored_mark != mark);
+    next = next->next;
+  }
+  
+  stored_mark = (gdouble*)g_memdup (&mark, sizeof (gdouble));
+  priv->marks = g_list_append (priv->marks, (gpointer)stored_mark);
+}
+
+/**
+ * gtk_scrollbar_clear_marks
+ * @scrollbar: a #GtkScrollbar
+ * 
+ * Removes any marks that have been added with gtk_scrollbar_add_mark().
+ *
+ * Since: 3.0
+ **/
+void
+gtk_scrollbar_clear_marks (GtkScrollbar *scrollbar)
+{
+  GList *marks, *next;
+  marks = GTK_SCROLLBAR_GET_PRIVATE (scrollbar)->marks;
+  next = marks;
+  
+  while (next)
+  {
+    g_free (next->data);
+    next = next->next;
+  }
+  
+  g_list_free (marks);
+  GTK_SCROLLBAR_GET_PRIVATE (scrollbar)->marks = NULL;
+}
+
+static void
+gtk_scrollbar_finalize (GObject *object)
+{
+  gtk_scrollbar_clear_marks (GTK_SCROLLBAR (object));
+  G_OBJECT_CLASS (gtk_scrollbar_parent_class)->finalize (object);
+}
+
diff --git a/gtk/gtkscrollbar.h b/gtk/gtkscrollbar.h
index 992bb0d..6d56c93 100644
--- a/gtk/gtkscrollbar.h
+++ b/gtk/gtkscrollbar.h
@@ -24,7 +24,7 @@
  * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
  */
 
-#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
+#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
 #error "Only <gtk/gtk.h> can be included directly."
 #endif
 
@@ -65,9 +65,12 @@ struct _GtkScrollbarClass
 };
 
 
-GType       gtk_scrollbar_get_type (void) G_GNUC_CONST;
-GtkWidget * gtk_scrollbar_new      (GtkOrientation  orientation,
-                                    GtkAdjustment  *adjustment);
+GType       gtk_scrollbar_get_type    (void) G_GNUC_CONST;
+GtkWidget * gtk_scrollbar_new         (GtkOrientation  orientation,
+                                       GtkAdjustment  *adjustment);
+void        gtk_scrollbar_add_mark    (GtkScrollbar   *scrollbar,
+                                       gdouble         mark);
+void        gtk_scrollbar_clear_marks (GtkScrollbar  *scrollbar);
 
 G_END_DECLS
 
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 9daf69a..4ea9a19 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -94,7 +94,8 @@ noinst_PROGRAMS =  $(TEST_PROGS)	\
 	testexpand			\
 	testexpander			\
 	testvolumebutton		\
-	testscrolledwindow
+	testscrolledwindow \
+	testscrollbar
 
 if USE_X11
 noinst_PROGRAMS += testerrors
@@ -182,6 +183,7 @@ testscrolledwindow_DEPENDENCIES = $(TEST_DEPS)
 testwindows_DEPENDENCIES = $(TEST_DEPS)
 testexpand_DEPENDENCIES = $(TEST_DEPS)
 testexpander_DEPENDENCIES = $(TEST_DEPS)
+testscrollbar_DEPENDENCIES = $(TEST_DEPS)
 
 flicker_LDADD = $(LDADDS)
 simple_LDADD = $(LDADDS)
@@ -255,6 +257,7 @@ testscrolledwindow_LDADD = $(LDADDS)
 testwindows_LDADD = $(LDADDS)
 testexpand_LDADD = $(LDADDS)
 testexpander_LDADD = $(LDADDS)
+testscrollbar_LDADD = $(LDADDS)
 
 testentrycompletion_SOURCES = 	\
 	prop-editor.c		\
@@ -376,6 +379,9 @@ testexpand_SOURCES = testexpand.c
 
 testexpander_SOURCES = testexpander.c
 
+testscrollbar_SOURCES =         \
+	testscrollbar.c
+
 EXTRA_DIST += 			\
 	prop-editor.h		\
 	testgtk.1 		\
diff --git a/tests/testscrollbar.c b/tests/testscrollbar.c
new file mode 100644
index 0000000..24a80b7
--- /dev/null
+++ b/tests/testscrollbar.c
@@ -0,0 +1,75 @@
+/* testscrollbar.c
+ * Copyright (C) 2010 Alberto Ruiz <alberto.ruiz@codethink.co.uk>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include <gtk/gtk.h>
+
+
+int
+main (int argc, char** argv)
+{
+  GtkWidget *win, *vbox, *hbox,
+            *sb1, *sb2, *sb3, *sb4;
+  GtkAdjustment *adj1, *adj2;
+  gtk_init (&argc, &argv);
+  
+  win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+
+  vbox = gtk_vbox_new (TRUE, 0);
+  hbox = gtk_hbox_new (TRUE, 0);
+  
+  gtk_container_add (GTK_CONTAINER (win), hbox);
+  
+  adj1 = GTK_ADJUSTMENT (gtk_adjustment_new (500, 0, 1000, 10, 100, 200));
+  adj2 = GTK_ADJUSTMENT (gtk_adjustment_new (500, 0, 1000, 10, 100, 200));
+  
+  sb1 = gtk_scrollbar_new (GTK_ORIENTATION_VERTICAL, adj1);
+  sb2 = gtk_scrollbar_new (GTK_ORIENTATION_VERTICAL, adj1);
+  sb3 = gtk_scrollbar_new (GTK_ORIENTATION_HORIZONTAL, adj2);
+  sb4 = gtk_scrollbar_new (GTK_ORIENTATION_HORIZONTAL, adj2);
+    
+  gtk_scrollbar_add_mark (GTK_SCROLLBAR (sb1), 0.0);
+  gtk_scrollbar_add_mark (GTK_SCROLLBAR (sb1), 0.5);
+  gtk_scrollbar_add_mark (GTK_SCROLLBAR (sb1), 1.0);
+  
+  gtk_scrollbar_add_mark (GTK_SCROLLBAR (sb2), 0.0);
+  gtk_scrollbar_add_mark (GTK_SCROLLBAR (sb2), 0.5);
+  gtk_scrollbar_add_mark (GTK_SCROLLBAR (sb2), 1.0);
+  
+  gtk_scrollbar_add_mark (GTK_SCROLLBAR (sb3), 0.0);
+  gtk_scrollbar_add_mark (GTK_SCROLLBAR (sb3), 0.5);
+  gtk_scrollbar_add_mark (GTK_SCROLLBAR (sb3), 1.0);
+  
+  gtk_scrollbar_add_mark (GTK_SCROLLBAR (sb4), 0.0);
+  gtk_scrollbar_add_mark (GTK_SCROLLBAR (sb4), 0.5);
+  gtk_scrollbar_add_mark (GTK_SCROLLBAR (sb4), 1.0);
+
+  gtk_widget_set_sensitive (sb2, FALSE);
+  gtk_widget_set_sensitive (sb4, FALSE);
+  
+  gtk_container_add (GTK_CONTAINER (hbox), sb1);
+  gtk_container_add (GTK_CONTAINER (hbox), sb2);
+  gtk_container_add (GTK_CONTAINER (hbox), vbox);
+  
+  gtk_container_add (GTK_CONTAINER (vbox), sb3);
+  gtk_container_add (GTK_CONTAINER (vbox), sb4);
+
+  gtk_widget_show_all (win);  
+  gtk_main ();
+  return 0;
+}
