From: jprocter Date: Fri, 23 Sep 2011 13:21:59 +0000 (+0100) Subject: try even harder to get focus - for benefit of windows 7 (JAL-943) X-Git-Tag: Release_2_7~25 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=367c039ca47ca16fbf722c53acde68a3842784c3;p=jalview.git try even harder to get focus - for benefit of windows 7 (JAL-943) --- diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index e1356b4..f8d2bf0 100644 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -358,6 +358,18 @@ public class Desktop extends jalview.jbgui.GDesktop implements { jvnews.refreshNews(); jvnews.toFront(); + // try real hard to get focus when the news is first opened + new Thread(new Runnable() { + @Override + public void run() + { + while (jvnews.isVisible() && !jvnews.requestFocusInWindow()) + { + try { Thread.sleep(50); } catch (InterruptedException x) {}; + } + + } + }).start(); } } }