From: gmungoc Date: Tue, 26 Jun 2018 07:49:32 +0000 (+0100) Subject: JAL-3032 don't place desktop at negative x or y position X-Git-Tag: Release_2_11_4_0~45^2~18^2~637^2~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=3cafa9521c7d546fe6c0753a852bb729abea6ad2;p=jalview.git JAL-3032 don't place desktop at negative x or y position --- diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index b4b0cdb..bc5db70 100644 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -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