X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTApplication.java;fp=src%2Fjexer%2FTApplication.java;h=8a338076d290fbaba784b7857864acfb6c4ccca4;hb=3c5921e6905d8ef8c6f4e0644a4144274cc6bedc;hp=dba59d7d7eaab7bc3f8f4c2e3f9866c1194ce713;hpb=564040def0ab28b40a9571aca3622643e28451f4;p=fanfix.git diff --git a/src/jexer/TApplication.java b/src/jexer/TApplication.java index dba59d7..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,14 +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(); - doRepaint(); } + for (Runnable invoke: invokes) { + invoke.run(); + } + doRepaint(); } @@ -2058,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();