X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTApplication.java;h=c0166b11c3daf492e7e5afc04ff0af4a0a2ca5a6;hb=4bc195601c6c8d59a3937645ed7bda68ec415348;hp=8b436ab9a99ec9219b9755ffce379c62d834e10f;hpb=e8a11f986bfe2556e450d7b8ad6ef0059b369bbc;p=nikiroo-utils.git diff --git a/src/jexer/TApplication.java b/src/jexer/TApplication.java index 8b436ab..c0166b1 100644 --- a/src/jexer/TApplication.java +++ b/src/jexer/TApplication.java @@ -1396,6 +1396,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 +1462,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 +1500,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 +1532,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 +1603,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 +1667,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. @@ -2420,6 +2461,16 @@ public class TApplication implements Runnable { return true; } + if (command.equals(cmMenu)) { + if (!modalWindowActive() && (activeMenu == null)) { + if (menus.size() > 0) { + menus.get(0).setActive(true); + activeMenu = menus.get(0); + return true; + } + } + } + return false; }