From d16a0b70878dd40275ea1316a131da695a94d9b6 Mon Sep 17 00:00:00 2001 From: jprocter Date: Sun, 19 Sep 2010 16:34:58 +0000 Subject: [PATCH] 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) --- src/jalview/gui/Desktop.java | 8 ++++++++ 1 file changed, 8 insertions(+) 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); -- 1.7.10.2