Fix lag in TTerminalWindow
[fanfix.git] / src / jexer / tterminal / ECMA48.java
index 31bb5b1573cda8d66922036a40027e117b52e83f..3702b8bc5bc64d3c9e9e454dbdb8179e464aafc0 100644 (file)
@@ -6083,16 +6083,16 @@ public class ECMA48 implements Runnable {
                     // This is EOF
                     done = true;
                 } else {
-                    for (int i = 0; i < rc; i++) {
-                        int ch = 0;
-                        if (utf8) {
-                            ch = readBufferUTF8[i];
-                        } else {
-                            ch = readBuffer[i];
-                        }
+                    // Don't step on UI events
+                    synchronized (this) {
+                        for (int i = 0; i < rc; i++) {
+                            int ch = 0;
+                            if (utf8) {
+                                ch = readBufferUTF8[i];
+                            } else {
+                                ch = readBuffer[i];
+                            }
 
-                        synchronized (this) {
-                            // Don't step on UI events
                             consume((char)ch);
                         }
                     }
@@ -6126,6 +6126,11 @@ public class ECMA48 implements Runnable {
             // SQUASH
         }
 
+        // Permit my enclosing UI to know that I updated.
+        if (displayListener != null) {
+            displayListener.displayChanged();
+        }
+
         // System.err.println("*** run() exiting..."); System.err.flush();
     }