fix for JAL-2419 - don’t trash the current selection
[jalview.git] / src / jalview / gui / SeqPanel.java
index 0046206..55f23aa 100644 (file)
@@ -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