--- forms.c_safe	Thu Jun 20 13:48:40 2002
+++ forms.c	Fri Jun 21 13:07:33 2002
@@ -50,6 +50,8 @@
 
 static int fl_XLookupString(XKeyEvent *, char *, int, KeySym *);
 
+void fl_redraw_form_using_xevent(FL_FORM *, int, XEvent *);
+
 
 #define SHORT_PAUSE          10	/* check_form wait             */
 
@@ -1361,7 +1363,7 @@
     {
 
     case FL_DRAW:		/* form must be redrawn */
-	fl_redraw_form(form);
+	fl_redraw_form_using_xevent(form, key, xev);
 	break;
     case FL_ENTER:		/* Mouse did enter the form */
 	fl_mouseobj = obj;
--- objects.c_safe	Thu Jun 20 13:38:24 2002
+++ objects.c	Fri Jun 21 13:07:14 2002
@@ -1266,7 +1266,7 @@
  */
 
 static void
-redraw_marked(FL_FORM * form)
+redraw_marked(FL_FORM * form, int key, XEvent * xev)
 {
     FL_OBJECT *ob;
 
@@ -1305,7 +1305,7 @@
 		fl_set_text_clipping(ob->x, ob->y, ob->w, ob->h);
 	    }
 
-	    fl_handle_object(ob, FL_DRAW, 0, 0, 0, 0);
+	    fl_handle_object(ob, FL_DRAW, 0, 0, key, xev);
 
 	    if ((ob->objclass == FL_FREE || ob->clip) && !fl_perm_clip)
 	    {
@@ -1350,26 +1350,40 @@
 
     /* if obj is a child object and the parent is not visible, do nothing */
     if (obj->visible && (!obj->is_child || obj->parent->visible))
-	redraw_marked(obj->form);
+	redraw_marked(obj->form, 0, 0);
 
 }
 
-/* Draws a form */
-void
-fl_redraw_form(FL_FORM * form)
+/* Marks all objects for redraw */
+static void
+mark_for_redraw(FL_FORM * form)
 {
     FL_OBJECT *ob;
 
     if (form == NULL)
     {
-	fl_error("fl_redraw_form", "Drawing NULL form.");
+	fl_error("mark_for_redraw", "Drawing NULL form.");
 	return;
     }
 
     for (ob = form->first; ob; ob = ob->next)
 	ob->redraw = 1;
+}
 
-    redraw_marked(form);
+/* Draws a form */
+void
+fl_redraw_form(FL_FORM * form)
+{
+    mark_for_redraw(form);
+    redraw_marked(form, 0, 0);
+}
+
+/* Draws a form */
+void
+fl_redraw_form_using_xevent(FL_FORM * form, int key, XEvent * xev)
+{
+    mark_for_redraw(form);
+    redraw_marked(form, key, xev);
 }
 
 /* Disables drawing of form */
@@ -1403,7 +1417,7 @@
     form->frozen--;
 
     if (form->frozen == 0)
-	redraw_marked(form);
+	redraw_marked(form, 0, 0);
 }
 
 /*-----------------------------------------------------------------------

