Ignoring repeated expose events

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Ignoring repeated expose events

Jay Catherwood
This patch ignores repeated expose events, reducing the very long periods
of nonresponsiveness I see with systems of thousands of atoms.

--
Jay

--- xmakemol-5.15/xmakemol.c    2005-03-06 12:04:34.000000000 -0500
+++ xmakemol-5.15.jc/xmakemol.c 2007-08-08 19:04:23.000000000 -0400
@@ -456,8 +456,14 @@ canvas_expose_cb(Widget widget, XtPointe
 {
   void canvas_cb(Widget, XtPointer, XtPointer);

-  redraw=1;
-  canvas_cb(canvas, NULL, NULL);
+  XmDrawingAreaCallbackStruct *dacs =
+    (XmDrawingAreaCallbackStruct *) call_data;
+  XExposeEvent *event = (XExposeEvent *) dacs->event;
+
+  if (!event->count) {
+    redraw=1;
+    canvas_cb(canvas, NULL, NULL);
+  }
 }

 void


_______________________________________________
XMakemol-bugs mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/xmakemol-bugs
Reply | Threaded
Open this post in threaded view
|

Re: Ignoring repeated expose events

Matt Hodges-2
>>>>> Jay Catherwood writes:

 > This patch ignores repeated expose events, reducing the very long
 > periods of nonresponsiveness I see with systems of thousands of
 > atoms.

Thanks, Jay.  Patch applied to the CVS sources.

Matt


_______________________________________________
XMakemol-bugs mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/xmakemol-bugs