From: jprocter Date: Sun, 19 Sep 2010 16:34:58 +0000 (+0000) Subject: hack to ensure that if window geometry was not stored correctly, windows are not... X-Git-Tag: Release_2_6~30 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=d16a0b70878dd40275ea1316a131da695a94d9b6;p=jalview.git hack to ensure that if window geometry was not stored correctly, windows are not placed outside the current screen dimensions (occurs with console occasionally in 2.5.x) --- diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index 8531e04..cf89494 100755 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -414,6 +414,14 @@ public class Desktop extends jalview.jbgui.GDesktop implements iw = (int) (iw * sw); iy = (int) (iy * sh); ih = (int) (ih * sh); + while (ix>=screenSize.width) { + jalview.bin.Cache.log.debug("Window geometry location recall error: shifting horizontal to within screenbounds."); + ix-=screenSize.width; + } + while (iy>=screenSize.height) { + jalview.bin.Cache.log.debug("Window geometry location recall error: shifting vertical to within screenbounds."); + iy-=screenSize.height; + } jalview.bin.Cache.log.debug("Got last known dimensions for " + windowName + ": x:" + ix + " y:" + iy + " width:" + iw + " height:" + ih);