From 6fa0f79908a356c2efa73d5518544daea904ae89 Mon Sep 17 00:00:00 2001 From: jprocter Date: Sun, 25 Sep 2011 17:05:58 +0100 Subject: [PATCH] more focus fixing (JAL-943) --- src/jalview/gui/Desktop.java | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index f8d2bf0..5dadeb3 100644 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -43,6 +43,8 @@ import javax.swing.*; import javax.swing.event.MenuEvent; import javax.swing.event.MenuListener; +import com.sun.xml.internal.ws.streaming.TidyXMLStreamReader; + /** * Jalview Desktop * @@ -302,7 +304,24 @@ public class Desktop extends jalview.jbgui.GDesktop implements } } }); - + this.addFocusListener(new FocusListener() + { + + @Override + public void focusLost(FocusEvent e) + { + // TODO Auto-generated method stub + + } + + @Override + public void focusGained(FocusEvent e) + { + Cache.log.debug("Relaying windows after focus gain"); + // make sure that we sort windows properly after we gain focus + instance.relayerWindows(); + } + }); this.setDropTarget(new java.awt.dnd.DropTarget(desktop, this)); // Spawn a thread that shows the splashscreen SwingUtilities.invokeLater(new Runnable() -- 1.7.10.2