X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTApplication.java;h=8a338076d290fbaba784b7857864acfb6c4ccca4;hb=3c5921e6905d8ef8c6f4e0644a4144274cc6bedc;hp=13cd07958ee3a61c9b36e2a76cf0f2560e48920a;hpb=51e46b3e9d457882e5dad35b79b0bd0d11654f04;p=fanfix.git diff --git a/src/jexer/TApplication.java b/src/jexer/TApplication.java index 13cd079..8a33807 100644 --- a/src/jexer/TApplication.java +++ b/src/jexer/TApplication.java @@ -164,16 +164,6 @@ public class TApplication implements Runnable { */ private int mouseY; - /** - * Old version of mouse coordinate X. - */ - private int oldMouseX; - - /** - * Old version mouse coordinate Y. - */ - private int oldMouseY; - /** * Old drawn version of mouse coordinate X. */ @@ -1196,8 +1186,6 @@ public class TApplication implements Runnable { } mouseX = 0; mouseY = 0; - oldMouseX = 0; - oldMouseY = 0; } if (desktop != null) { desktop.setDimensions(0, desktopTop, resize.getWidth(), @@ -1275,8 +1263,6 @@ public class TApplication implements Runnable { } if ((mouseX != mouse.getX()) || (mouseY != mouse.getY())) { - oldMouseX = mouseX; - oldMouseY = mouseY; mouseX = mouse.getX(); mouseY = mouse.getY(); } else { @@ -1465,8 +1451,6 @@ public class TApplication implements Runnable { TMouseEvent mouse = (TMouseEvent) event; if ((mouseX != mouse.getX()) || (mouseY != mouse.getY())) { - oldMouseX = mouseX; - oldMouseY = mouseY; mouseX = mouse.getX(); mouseY = mouse.getY(); } else { @@ -1593,13 +1577,17 @@ public class TApplication implements Runnable { desktop.onIdle(); } - // Run any invokeLaters + // Run any invokeLaters. We make a copy, and run that, because one + // of these Runnables might add call TApplication.invokeLater(). + List invokes = new ArrayList(); synchronized (invokeLaters) { - for (Runnable invoke: invokeLaters) { - invoke.run(); - } + invokes.addAll(invokeLaters); invokeLaters.clear(); } + for (Runnable invoke: invokes) { + invoke.run(); + } + doRepaint(); } @@ -2057,7 +2045,9 @@ public class TApplication implements Runnable { // Draw the status bar of the top-level window TStatusBar statusBar = null; if (topLevel != null) { - statusBar = topLevel.getStatusBar(); + if (topLevel.isShown()) { + statusBar = topLevel.getStatusBar(); + } } if (statusBar != null) { getScreen().resetClipping();