From 9bfda76754fb426a471e1c12c9f0ca0c4c1784bc Mon Sep 17 00:00:00 2001 From: James Procter Date: Wed, 10 Jan 2024 15:51:52 +0000 Subject: [PATCH] JAL-4369 invokeAndWait to avoid hang whilst calling getFiles if a Jmol redraw is in progress --- src/jalview/bin/Commands.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/jalview/bin/Commands.java b/src/jalview/bin/Commands.java index e01d40a..4265842 100644 --- a/src/jalview/bin/Commands.java +++ b/src/jalview/bin/Commands.java @@ -1267,8 +1267,19 @@ public class Commands private void colourAlignFrame(AlignFrame af, ColourSchemeI cs) { - // Note that cs == null removes colour scheme from af - af.changeColour(cs); + try { + SwingUtilities.invokeAndWait(new Runnable() + { + @Override + public void run() + { + // Note that cs == null removes colour scheme from af + af.changeColour(cs); + } + }); } catch (Exception x) { + Console.trace("Interrupted whilst waiting for colorAlignFrame action",x); + + } } private ColourSchemeI getColourScheme(AlignFrame af) -- 1.7.10.2