From 3cafa9521c7d546fe6c0753a852bb729abea6ad2 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Tue, 26 Jun 2018 08:49:32 +0100 Subject: [PATCH] JAL-3032 don't place desktop at negative x or y position --- src/jalview/gui/Desktop.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 -- 1.7.10.2