try even harder to get focus - for benefit of windows 7 (JAL-943)
authorjprocter <jprocter@compbio.dundee.ac.uk>
Fri, 23 Sep 2011 13:21:59 +0000 (14:21 +0100)
committerjprocter <jprocter@compbio.dundee.ac.uk>
Fri, 23 Sep 2011 13:21:59 +0000 (14:21 +0100)
src/jalview/gui/Desktop.java

index e1356b4..f8d2bf0 100644 (file)
@@ -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();
       }
     }
   }