diff --git a/gtk/gtkcurve.c b/gtk/gtkcurve.c
index d996a2d..260a682 100644
--- a/gtk/gtkcurve.c
+++ b/gtk/gtkcurve.c
@@ -736,9 +736,20 @@ gtk_curve_size_graph (GtkCurve *curve)
   else
     height = width / aspect;
 
-  gtk_widget_set_size_request (GTK_WIDGET (curve),
-			       width + RADIUS * 2,
-			       height + RADIUS * 2);
+  width = width + RADIUS * 2;
+  height = height + RADIUS * 2;
+
+  if (width < 0)
+    width *= -1;
+  if (height < 0)
+    height *= -1;
+
+  if (width > gdk_screen_get_width (screen) / 4)
+    width  = gdk_screen_get_width (screen) / 4;
+  if (height > gdk_screen_get_height (screen) / 4)
+    height = gdk_screen_get_height (screen) / 4;
+
+  gtk_widget_set_size_request (GTK_WIDGET (curve), width, height);
 }
 
 static void
diff --git a/tests/testgtk.c b/tests/testgtk.c
index ccb06c8..70c9b71 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -6282,6 +6282,67 @@ create_cursors (GtkWidget *widget)
 }
 
 /*
+ * GtkCurve
+ */
+
+static void
+curve_value_cb (GtkSpinButton *entry,
+                GtkWidget     *curve)
+{
+    const gchar* value = g_object_get_data (G_OBJECT (entry), "value");
+    g_object_set (curve, value, gtk_spin_button_get_value (entry), NULL);
+}
+
+static void
+create_curve (GtkWidget *widget)
+{
+  static GtkWidget *window = NULL;
+  GtkWidget *vbox;
+  GtkWidget *hbox;
+  GtkWidget *entry;
+  GtkWidget *curve;
+
+  if (!window)
+    {
+      window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+      gtk_window_set_screen (GTK_WINDOW (window), 
+			     gtk_widget_get_screen (widget));
+
+      g_signal_connect (window, "destroy",
+			G_CALLBACK (gtk_widget_destroyed),
+			&window);
+
+      gtk_window_set_title (GTK_WINDOW (window), "Curve");
+
+      vbox = gtk_vbox_new (FALSE, 4);
+      gtk_container_add (GTK_CONTAINER (window), vbox);
+
+      hbox = gtk_hbox_new (TRUE, 4);
+      gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 4);
+
+      curve = gtk_curve_new ();
+
+      #define VALUE(valuename,default) \
+      entry = gtk_spin_button_new_with_range (-G_MAXDOUBLE, G_MAXDOUBLE, 0.1); \
+      gtk_box_pack_start (GTK_BOX (hbox), entry, FALSE, FALSE, 4); \
+      gtk_spin_button_set_value (GTK_SPIN_BUTTON (entry), default); \
+      g_object_set_data (G_OBJECT (entry), "value", valuename); \
+      g_signal_connect (entry, "value-changed", G_CALLBACK (curve_value_cb), curve)
+
+      VALUE ("min-x", 0.0);
+      VALUE ("max-x", 1.0);
+      VALUE ("min-y", 0.0);
+      VALUE ("max-y", 1.0);
+
+      gtk_box_pack_start (GTK_BOX (vbox), curve, TRUE, TRUE, 4);
+
+      gtk_widget_show_all (window);
+    }
+  else
+    gtk_widget_destroy (window);
+}
+
+/*
  * GtkList
  */
 
@@ -13601,6 +13662,7 @@ struct {
   { "composited window", create_composited_window },
   { "ctree", create_ctree },
   { "cursors", create_cursors },
+  { "curve", create_curve },
   { "dialog", create_dialog, TRUE },
   { "display & screen", create_display_screen, TRUE },
   { "entry", create_entry },
