1996167fcc541ce772384a0f13ea89ccf8de5b6f
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index 3f8d717..2912651 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -1494,17 +1494,23 @@ static gboolean
 gtk_scrolled_window_scroll_event (GtkWidget      *widget,
 				  GdkEventScroll *event)
 {
+  GtkScrolledWindow *scrolled_window = GTK_SCROLLED_WINDOW (widget);
+  GtkWidget *ranges[2] = { scrolled_window->hscrollbar, scrolled_window->vscrollbar };
   GtkWidget *range;
+  gboolean is_vertical;
 
-  g_return_val_if_fail (GTK_IS_SCROLLED_WINDOW (widget), FALSE);
-  g_return_val_if_fail (event != NULL, FALSE);  
+  is_vertical = (event->direction == GDK_SCROLL_UP || event->direction == GDK_SCROLL_DOWN);
 
-  if (event->direction == GDK_SCROLL_UP || event->direction == GDK_SCROLL_DOWN)
-    range = GTK_SCROLLED_WINDOW (widget)->vscrollbar;
-  else
-    range = GTK_SCROLLED_WINDOW (widget)->hscrollbar;
+  /* Make Shift+Scroll scroll in the orthogonal direction */
+  if (event->state & GDK_SHIFT_MASK)
+    is_vertical = !is_vertical;
+
+  range = ranges[is_vertical];
+  /* If this scrollbar isn't visible, scroll in the orthogonal direction */
+  if (!GTK_WIDGET_VISIBLE (range))
+    range = ranges[!is_vertical];
 
-  if (range && GTK_WIDGET_VISIBLE (range))
+  if (GTK_WIDGET_VISIBLE (range))
     {
       GtkAdjustment *adj = GTK_RANGE (range)->adjustment;
       gdouble delta;
