X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTApplication.java;h=1b396a73eca33bd80f6cbfbc4765113e4783d7b3;hb=d610cbd252f5595f2558960b97424d67c7ffe84c;hp=20406b1f8e82aa654efa86081c085d5f3883af03;hpb=00691e80f2f135f92be739e2b7e86775a2357276;p=fanfix.git diff --git a/src/jexer/TApplication.java b/src/jexer/TApplication.java index 20406b1..1b396a7 100644 --- a/src/jexer/TApplication.java +++ b/src/jexer/TApplication.java @@ -936,6 +936,7 @@ public class TApplication implements Runnable { if (desktop != null) { desktop.setDimensions(0, 0, resize.getWidth(), resize.getHeight() - 1); + desktop.onResize(resize); } // Change menu edges if needed. @@ -1508,6 +1509,18 @@ public class TApplication implements Runnable { } } + /** + * Check if application is still running. + * + * @return true if the application is running + */ + public final boolean isRunning() { + if (quit == true) { + return false; + } + return true; + } + // ------------------------------------------------------------------------ // Screen refresh loop ---------------------------------------------------- // ------------------------------------------------------------------------ @@ -1777,6 +1790,10 @@ public class TApplication implements Runnable { // Flush the screen contents if ((images.size() > 0) || getScreen().isDirty()) { + if (debugThreads) { + System.err.printf("%d %s backend.flushScreen()\n", + System.currentTimeMillis(), Thread.currentThread()); + } backend.flushScreen(); } @@ -1908,7 +1925,8 @@ public class TApplication implements Runnable { assert (!window.isActive()); if (activeWindow != null) { - assert (activeWindow.getZ() == 0); + // TODO: see if this assertion is really necessary. + // assert (activeWindow.getZ() == 0); activeWindow.setActive(false); @@ -2241,6 +2259,21 @@ public class TApplication implements Runnable { return false; } + /** + * Check if there is a window with overridden menu flag on top. + * + * @return true if the active window is overriding the menu + */ + private boolean overrideMenuWindowActive() { + if (activeWindow != null) { + if (activeWindow.hasOverriddenMenu()) { + return true; + } + } + + return false; + } + /** * Close all open windows. */ @@ -2571,6 +2604,7 @@ public class TApplication implements Runnable { if ((mouse.getType() == TMouseEvent.Type.MOUSE_DOWN) && (mouse.isMouse1()) && (!modalWindowActive()) + && (!overrideMenuWindowActive()) && (mouse.getAbsoluteY() == 0) ) {