JAL-4298 Added diagnostics and minor dimension changes to Java Console. Added a...
[jalview.git] / src / jalview / gui / Desktop.java
index 47b8893..e0e2307 100644 (file)
@@ -113,6 +113,7 @@ import jalview.api.structures.JalviewStructureDisplayI;
 import jalview.bin.Cache;
 import jalview.bin.Jalview;
 import jalview.bin.Jalview.ExitCode;
+import jalview.bin.argparser.Arg;
 import jalview.datamodel.Alignment;
 import jalview.datamodel.HiddenColumns;
 import jalview.datamodel.Sequence;
@@ -498,7 +499,8 @@ public class Desktop extends jalview.jbgui.GDesktop
 
     boolean selmemusage = Cache.getDefault("SHOW_MEMUSAGE", false);
 
-    boolean showjconsole = Cache.getDefault("SHOW_JAVA_CONSOLE", false);
+    boolean showjconsole = Cache.getArgCacheDefault(Arg.JAVACONSOLE,
+            "SHOW_JAVA_CONSOLE", false);
 
     // start dialogue queue for single dialogues
     startDialogQueue();
@@ -800,17 +802,17 @@ public class Desktop extends jalview.jbgui.GDesktop
         iw = (int) (iw * sw);
         iy = (int) (iy * sh);
         ih = (int) (ih * sh);
-        while (ix >= screenSize.width)
+        if (ix >= screenSize.width)
         {
           jalview.bin.Console.debug(
                   "Window geometry location recall error: shifting horizontal to within screenbounds.");
-          ix -= screenSize.width;
+          ix = ix % screenSize.width;
         }
-        while (iy >= screenSize.height)
+        if (iy >= screenSize.height)
         {
           jalview.bin.Console.debug(
                   "Window geometry location recall error: shifting vertical to within screenbounds.");
-          iy -= screenSize.height;
+          iy = iy % screenSize.height;
         }
         jalview.bin.Console.debug(
                 "Got last known dimensions for " + windowName + ": x:" + ix