From c1ce863a70369f7d1794c6e5dd1943c21ee36cfe Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Fri, 12 Nov 2010 20:18:03 -0700 Subject: [PATCH] experiment with explicit flush in 2htdp/world --- collects/2htdp/private/world.rkt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/collects/2htdp/private/world.rkt b/collects/2htdp/private/world.rkt index 6a1d772bd0..9c275df1ba 100644 --- a/collects/2htdp/private/world.rkt +++ b/collects/2htdp/private/world.rkt @@ -211,9 +211,15 @@ (let ([s (send visible find-first-snip)] [c (send visible get-canvas)]) (when s (send visible delete s)) - (send visible insert (send pict copy) 0 0)) - (send visible lock #t) - (send visible end-edit-sequence)) + (send visible insert (send pict copy) 0 0) + (send visible lock #t) + (send visible end-edit-sequence) + ;; The following flush trades streaming performance (where updates + ;; could be skipped if they're replaced fast enough) for + ;; responsiveness (where too many updates might not get + ;; through if the canvas is mostly in suspended-refresh + ;; mode for scene changes): + (send c flush))) ;; ---------------------------------------------------------------------- ;; callbacks