From: Jim Procter Date: Wed, 15 Feb 2017 17:12:02 +0000 (+0000) Subject: fix for JAL-2419 - don’t trash the current selection X-Git-Tag: Release_2_10_3b1~344^2~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=d38a8b5baa757886792e4a3c5cb0b3877b25a256;p=jalview.git fix for JAL-2419 - don’t trash the current selection --- diff --git a/src/jalview/appletgui/SeqPanel.java b/src/jalview/appletgui/SeqPanel.java index 904e3ce..1352fe9 100644 --- a/src/jalview/appletgui/SeqPanel.java +++ b/src/jalview/appletgui/SeqPanel.java @@ -1426,7 +1426,12 @@ public class SeqPanel extends Panel implements MouseMotionListener, if (stretchGroup == null || !stretchGroup.contains(sequence, res)) { stretchGroup = av.getAlignment().findGroup(sequence, res); - av.setSelectionGroup(stretchGroup); + if (stretchGroup != null) + { + // only update the current selection if the popup menu has a group to + // focus on + av.setSelectionGroup(stretchGroup); + } } // DETECT RIGHT MOUSE BUTTON IN AWT diff --git a/src/jalview/gui/SeqPanel.java b/src/jalview/gui/SeqPanel.java index 0046206..55f23aa 100644 --- a/src/jalview/gui/SeqPanel.java +++ b/src/jalview/gui/SeqPanel.java @@ -1590,7 +1590,12 @@ public class SeqPanel extends JPanel implements MouseListener, if (stretchGroup == null || !stretchGroup.contains(sequence, res)) { stretchGroup = av.getAlignment().findGroup(sequence, res); - av.setSelectionGroup(stretchGroup); + if (stretchGroup != null) + { + // only update the current selection if the popup menu has a group to + // focus on + av.setSelectionGroup(stretchGroup); + } } if (evt.isPopupTrigger()) // Mac: mousePressed