X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTApplication.java;h=9d27c10f5420052103cee046baae697ca8c2bd6e;hb=12b90437b5f22c2ae6e9b9b14c3b62b60f6143e5;hp=14ebacda7f4fa0a645c0958018d1bb8871f332e9;hpb=2bc32111fa17ae50a8aaa09ab347191fefc494a1;p=fanfix.git diff --git a/src/jexer/TApplication.java b/src/jexer/TApplication.java index 14ebacd..9d27c10 100644 --- a/src/jexer/TApplication.java +++ b/src/jexer/TApplication.java @@ -869,6 +869,11 @@ public class TApplication implements Runnable { // resources. closeAllWindows(); + // Close the desktop. + if (desktop != null) { + setDesktop(null); + } + // Give the overarching application an opportunity to release // resources. onExit(); @@ -1611,6 +1616,8 @@ public class TApplication implements Runnable { */ public final void setDesktop(final TDesktop desktop) { if (this.desktop != null) { + this.desktop.onPreClose(); + this.desktop.onUnfocus(); this.desktop.onClose(); } this.desktop = desktop; @@ -1759,6 +1766,19 @@ public class TApplication implements Runnable { } } + // If this cell is on top of the desktop, and the desktop has + // requested a hidden mouse, bail out. + if ((desktop != null) && (activeWindow == null) && (activeMenu == null)) { + if ((desktop.hasHiddenMouse() == true) + && (x > desktop.getX()) + && (x < desktop.getX() + desktop.getWidth() - 1) + && (y > desktop.getY()) + && (y < desktop.getY() + desktop.getHeight() - 1) + ) { + return; + } + } + Cell cell = getScreen().getCharXY(x, y); if (cell.isImage()) { cell.invertImage(); @@ -2182,9 +2202,6 @@ public class TApplication implements Runnable { assert (!window.isActive()); if (activeWindow != null) { - // TODO: see if this assertion is really necessary. - // assert (activeWindow.getZ() == 0); - activeWindow.setActive(false); // Increment every window Z that is on top of window