about summary refs log tree commit diff stats
path: root/074console.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-07-08 21:03:32 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-07-08 21:03:32 -0700
commit5e9eff8ca137dcb929e9c986d6aaa42c762caf61 (patch)
tree92292231115f8e7702021b728e0fe07389959c00 /074console.mu
parentc12cca678e2d9e25155426649626ab36a79fcacc (diff)
downloadmu-5e9eff8ca137dcb929e9c986d6aaa42c762caf61.tar.gz
1731 - ah, now fully responsive
The trick is to check for more events and not bother rendering if so.
Diffstat (limited to '074console.mu')
-rw-r--r--074console.mu13
1 files changed, 13 insertions, 0 deletions
diff --git a/074console.mu b/074console.mu
index 1d9702da..8ec8e1e9 100644
--- a/074console.mu
+++ b/074console.mu
@@ -100,3 +100,16 @@ recipe wait-for-event [
     loop-unless found?:boolean
   }
 ]
+
+# use this helper to skip rendering if there's lots of other events queued up
+recipe has-more-events? [
+  default-space:address:array:location <- new location:type, 30:literal
+  console:address <- next-ingredient
+  {
+    break-unless console:address
+    # fake consoles should be plenty fast; never skip
+    reply 0:literal/false
+  }
+  result:boolean <- interactions-left?
+  reply result:boolean
+]