misc cleanup
[fanfix.git] / src / jexer / backend / ECMA48Backend.java
index a6ae361c791d975c152587aaaebbf62a11e85d14..da9c9c35d8f13794cd820311eedcdd1ffc0fc99a 100644 (file)
@@ -43,7 +43,7 @@ import jexer.io.ECMA48Terminal;
  * This class uses an xterm/ANSI X3.64/ECMA-48 type terminal to provide a
  * screen, keyboard, and mouse to TApplication.
  */
-public class ECMA48Backend extends Backend {
+public final class ECMA48Backend extends Backend {
 
     /**
      * Input events are processed by this Terminal.
@@ -84,7 +84,7 @@ public class ECMA48Backend extends Backend {
      * Sync the logical screen to the physical device.
      */
     @Override
-    public final void flushScreen() {
+    public void flushScreen() {
         screen.flushPhysical();
     }
 
@@ -103,20 +103,13 @@ public class ECMA48Backend extends Backend {
             synchronized (terminal) {
                 try {
                     terminal.wait(timeout);
-                    if (terminal.hasEvents()) {
-                        // System.err.println("getEvents()");
-                        terminal.getEvents(queue);
-                    } else {
-                        // If I got here, then I timed out.  Call
-                        // terminal.getIdleEvents() to pick up stragglers
-                        // like bare resize.
-                        // System.err.println("getIdleEvents()");
-                        terminal.getIdleEvents(queue);
-                    }
                 } catch (InterruptedException e) {
                     // Spurious interrupt, pretend it was like a timeout.
                     // System.err.println("[interrupt] getEvents()");
-                    terminal.getIdleEvents(queue);
+                }
+                if (terminal.hasEvents()) {
+                    // System.err.println("getEvents()");
+                    terminal.getEvents(queue);
                 }
             }
         } else {
@@ -130,7 +123,7 @@ public class ECMA48Backend extends Backend {
      * Close the I/O, restore the console, etc.
      */
     @Override
-    public final void shutdown() {
+    public void shutdown() {
         terminal.shutdown();
     }