X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTApplication.java;h=09f617ed82fd45a259ce62410d1d35e82641cf03;hb=2027327cd9f53c15082f3bec9b4bb953d858a53f;hp=691e1c7295f087e700f469c86bab059aa256cb41;hpb=71a389c9810382e014682dde52e94d3f34e385fa;p=nikiroo-utils.git diff --git a/src/jexer/TApplication.java b/src/jexer/TApplication.java index 691e1c7..09f617e 100644 --- a/src/jexer/TApplication.java +++ b/src/jexer/TApplication.java @@ -931,10 +931,16 @@ public class TApplication implements Runnable { * Run this application until it exits. */ public void run() { + boolean first = true; + while (!quit) { // Timeout is in milliseconds, so default timeout after 1 second // of inactivity. long timeout = 1000; + if (first) { + first = false; + timeout = 0; + } // If I've got no updates to render, wait for something from the // backend or a timer. @@ -1396,6 +1402,13 @@ public class TApplication implements Runnable { return; } + // Whatever window might be moving/dragging, stop it now. + for (TWindow w: windows) { + if (w.inMovements()) { + w.stopMovements(); + } + } + assert (windows.size() > 0); if (window.isHidden()) { @@ -1455,6 +1468,13 @@ public class TApplication implements Runnable { return; } + // Whatever window might be moving/dragging, stop it now. + for (TWindow w: windows) { + if (w.inMovements()) { + w.stopMovements(); + } + } + assert (windows.size() > 0); if (!window.hidden) { @@ -1486,6 +1506,13 @@ public class TApplication implements Runnable { return; } + // Whatever window might be moving/dragging, stop it now. + for (TWindow w: windows) { + if (w.inMovements()) { + w.stopMovements(); + } + } + assert (windows.size() > 0); if (window.hidden) { @@ -1511,6 +1538,13 @@ public class TApplication implements Runnable { } synchronized (windows) { + // Whatever window might be moving/dragging, stop it now. + for (TWindow w: windows) { + if (w.inMovements()) { + w.stopMovements(); + } + } + int z = window.getZ(); window.setZ(-1); window.onUnfocus(); @@ -1575,6 +1609,12 @@ public class TApplication implements Runnable { assert (activeWindow != null); synchronized (windows) { + // Whatever window might be moving/dragging, stop it now. + for (TWindow w: windows) { + if (w.inMovements()) { + w.stopMovements(); + } + } // Swap z/active between active window and the next in the list int activeWindowI = -1; @@ -1633,6 +1673,13 @@ public class TApplication implements Runnable { } synchronized (windows) { + // Whatever window might be moving/dragging, stop it now. + for (TWindow w: windows) { + if (w.inMovements()) { + w.stopMovements(); + } + } + // Do not allow a modal window to spawn a non-modal window. If a // modal window is active, then this window will become modal // too.