JAL-3032 don't place desktop at negative x or y position
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 26 Jun 2018 07:49:32 +0000 (08:49 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 26 Jun 2018 07:49:32 +0000 (08:49 +0100)
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