From: Kevin Lamonte Date: Wed, 30 Oct 2019 15:13:44 +0000 (-0500) Subject: #60 keep focus for all window mouse resize X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=6b45ccfe7dde255ea27c512d8fdf050bb324c5af;p=fanfix-jexer.git #60 keep focus for all window mouse resize --- diff --git a/src/jexer/TWindow.java b/src/jexer/TWindow.java index 58195c9..ae3b85d 100644 --- a/src/jexer/TWindow.java +++ b/src/jexer/TWindow.java @@ -541,12 +541,6 @@ public class TWindow extends TWidget { } if (inWindowResize) { - // Do not permit resizing below the status line - if (mouse.getAbsoluteY() == application.getDesktopBottom()) { - inWindowResize = false; - return; - } - // Move window over setWidth(resizeWindowWidth + (mouse.getAbsoluteX() - moveWindowMouseX)); @@ -566,23 +560,22 @@ public class TWindow extends TWidget { // Keep within min/max bounds if (getWidth() < minimumWindowWidth) { setWidth(minimumWindowWidth); - inWindowResize = false; } if (getHeight() < minimumWindowHeight) { setHeight(minimumWindowHeight); - inWindowResize = false; } if ((maximumWindowWidth > 0) && (getWidth() > maximumWindowWidth) ) { setWidth(maximumWindowWidth); - inWindowResize = false; } if ((maximumWindowHeight > 0) && (getHeight() > maximumWindowHeight) ) { setHeight(maximumWindowHeight); - inWindowResize = false; + } + if (getHeight() + getY() >= getApplication().getDesktopBottom()) { + setHeight(getApplication().getDesktopBottom() - getY()); } // Pass a resize event to my children