retrofit from GJexer
[nikiroo-utils.git] / src / jexer / TApplication.java
index 41981daf3c3ca0e3943223534de125e0c943d835..20406b1f8e82aa654efa86081c085d5f3883af03 100644 (file)
@@ -1522,7 +1522,26 @@ public class TApplication implements Runnable {
         if (debugThreads) {
             System.err.printf("%d %s invertCell() %d %d\n",
                 System.currentTimeMillis(), Thread.currentThread(), x, y);
+
+            if (activeWindow != null) {
+                System.err.println("activeWindow.hasHiddenMouse() " +
+                    activeWindow.hasHiddenMouse());
+            }
         }
+
+        // If this cell is on top of a visible window that has requested a
+        // hidden mouse, bail out.
+        if ((activeWindow != null) && (activeMenu == null)) {
+            if ((activeWindow.hasHiddenMouse() == true)
+                && (x > activeWindow.getX())
+                && (x < activeWindow.getX() + activeWindow.getWidth() - 1)
+                && (y > activeWindow.getY())
+                && (y < activeWindow.getY() + activeWindow.getHeight() - 1)
+            ) {
+                return;
+            }
+        }
+
         Cell cell = getScreen().getCharXY(x, y);
         if (cell.isImage()) {
             cell.invertImage();
@@ -3298,7 +3317,7 @@ public class TApplication implements Runnable {
     public final TTerminalWindow openTerminal(final int x, final int y,
         final int flags, final String commandLine) {
 
-        return new TTerminalWindow(this, x, y, flags, commandLine.split("\\s"));
+        return new TTerminalWindow(this, x, y, flags, commandLine.split("\\s+"));
     }
 
     /**
@@ -3315,7 +3334,7 @@ public class TApplication implements Runnable {
     public final TTerminalWindow openTerminal(final int x, final int y,
         final int flags, final String commandLine, final boolean closeOnExit) {
 
-        return new TTerminalWindow(this, x, y, flags, commandLine.split("\\s"),
+        return new TTerminalWindow(this, x, y, flags, commandLine.split("\\s+"),
             closeOnExit);
     }