fix for JAL-2419 - don’t trash the current selection
[jalview.git] / src / jalview / appletgui / SeqPanel.java
index 904e3ce..1352fe9 100644 (file)
@@ -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