From d99d6a98cd0a7009e94ca4166f48741af75cde1e Mon Sep 17 00:00:00 2001 From: jprocter Date: Fri, 23 Sep 2011 14:01:02 +0100 Subject: [PATCH] ensure blog window gets put to front after dialogs close (JAL-943) --- src/jalview/gui/Desktop.java | 11 +++++++++++ src/jalview/gui/PromptUserConfig.java | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index bb84612..e1356b4 100644 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -1986,6 +1986,17 @@ public class Desktop extends jalview.jbgui.GDesktop implements } + /** + * fixes stacking order after a modal dialog to ensure windows that should be on top actually are + */ + public void relayerWindows() + { + if (jvnews!=null && jvnews.isVisible()) + { + jvnews.toFront(); + } + } + protected JMenuItem groovyShell; public void doGroovyCheck() diff --git a/src/jalview/gui/PromptUserConfig.java b/src/jalview/gui/PromptUserConfig.java index ac15f2b..942b20a 100644 --- a/src/jalview/gui/PromptUserConfig.java +++ b/src/jalview/gui/PromptUserConfig.java @@ -206,6 +206,12 @@ public class PromptUserConfig implements Runnable (allowCancel) ? JOptionPane.YES_NO_CANCEL_OPTION : JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); + // now, ask the desktop to relayer any external windows that might have been obsured + if (Desktop.instance!=null) + { + Desktop.instance.relayerWindows(); + } + // and finish parsing the result jalview.bin.Cache.log.debug("Got response : " + reply); if (reply == JOptionPane.YES_OPTION) { -- 1.7.10.2