#60 keep focus for all window mouse resize
authorKevin Lamonte <kevin.lamonte@gmail.com>
Wed, 30 Oct 2019 15:13:44 +0000 (10:13 -0500)
committerKevin Lamonte <kevin.lamonte@gmail.com>
Wed, 30 Oct 2019 15:13:44 +0000 (10:13 -0500)
src/jexer/TWindow.java

index 58195c915f1ae885485891f159539f53ece7b474..ae3b85dd01fe8e2b0d7379836e14b833e2e792a6 100644 (file)
@@ -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