JAL-3032 don't place desktop at negative x or y position
[jalview.git] / src / jalview / gui / Desktop.java
index b4b0cdb..bc5db70 100644 (file)
@@ -379,8 +379,9 @@ public class Desktop extends jalview.jbgui.GDesktop
     else
     {
       Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
-      setBounds((screenSize.width - 900) / 2, (screenSize.height - 650) / 2,
-              900, 650);
+      int xPos = Math.max(5, (screenSize.width - 900) / 2);
+      int yPos = Math.max(5, (screenSize.height - 650) / 2);
+      setBounds(xPos, yPos, 900, 650);
     }
     /**
      * BH 2018