Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java	(revision 6037)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java	(revision 6038)
@@ -6,4 +6,5 @@
 import java.awt.BorderLayout;
 import java.awt.Color;
+import java.awt.Component;
 import java.awt.event.ActionEvent;
 import java.awt.event.KeyEvent;
@@ -20,4 +21,5 @@
 import javax.swing.AbstractListModel;
 import javax.swing.DefaultListSelectionModel;
+import javax.swing.FocusManager;
 import javax.swing.JComponent;
 import javax.swing.JList;
@@ -189,8 +191,11 @@
         popupMenuHandler.setPrimitives(sel);
         
+        Component focused = FocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
+        
         //update highlights
-        if (Main.isDisplayingMapView()) {
-            highlightHelper.highlightOnly(sel);
-            Main.map.mapView.repaint();
+        if (focused==displaylist && Main.isDisplayingMapView()) {
+            if (highlightHelper.highlightOnly(sel)) {
+                Main.map.mapView.repaint();
+            }
         }
     }
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java	(revision 6037)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java	(revision 6038)
@@ -202,6 +202,7 @@
                 layer.data.setSelected(Collections.singleton((OsmPrimitive)model.getElementAt(idx)));
             } else if (Main.isDisplayingMapView()) {
-                helper.highlightOnly((OsmPrimitive)model.getElementAt(idx));
-                Main.map.mapView.repaint();
+                if (helper.highlightOnly((OsmPrimitive)model.getElementAt(idx))) {
+                    Main.map.mapView.repaint();
+                }
             }
         }
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java	(revision 6037)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java	(revision 6038)
@@ -418,6 +418,7 @@
                     int row = membershipTable.rowAtPoint(e.getPoint());
                     if (row>=0) {
-                        highlightHelper.highlightOnly((Relation) membershipTable.getValueAt(row, 0));
-                        Main.map.mapView.repaint();
+                        if (highlightHelper.highlightOnly((Relation) membershipTable.getValueAt(row, 0))) {
+                            Main.map.mapView.repaint();
+                        }
                     }
                 }
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java	(revision 6037)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java	(revision 6038)
@@ -609,4 +609,5 @@
             // make sure all registered listeners are unregistered
             //
+            memberTable.stopHighlighting();
             selectionTableModel.unregister();
             memberTableModel.unregister();
@@ -1358,4 +1359,5 @@
         public void run() {
             Main.pref.put("relation.editor.generic.lastrole", tfRole.getText());
+            memberTable.stopHighlighting();
             if (getRelation() == null) {
                 applyNewRelation();
@@ -1398,4 +1400,5 @@
         @Override
         public void actionPerformed(ActionEvent e) {
+            memberTable.stopHighlighting();
             if (!memberTableModel.hasSameMembersAs(getRelationSnapshot()) || tagEditorPanel.getModel().isDirty()) {
                 //give the user a chance to save the changes
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTable.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTable.java	(revision 6037)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTable.java	(revision 6038)
@@ -21,4 +21,5 @@
 import javax.swing.KeyStroke;
 import javax.swing.ListSelectionModel;
+import javax.swing.SwingUtilities;
 import javax.swing.event.ListSelectionEvent;
 import javax.swing.event.ListSelectionListener;
@@ -118,11 +119,10 @@
     }
 
-    private void initHighlighting() {
-        getMemberTableModel().getSelectionModel().addListSelectionListener(new ListSelectionListener() {
+    ListSelectionListener highlighterListener = new ListSelectionListener() {
             @Override
             public void valueChanged(ListSelectionEvent lse) {
                 if (Main.isDisplayingMapView()) {
                     Collection<RelationMember> sel = getMemberTableModel().getSelectedMembers();
-                    ArrayList<OsmPrimitive> toHighlight = new ArrayList<OsmPrimitive>();
+                    final ArrayList<OsmPrimitive> toHighlight = new ArrayList<OsmPrimitive>();
                     for (RelationMember r: sel) {
                         if (r.getMember().isUsable()) {
@@ -130,9 +130,17 @@
                         }
                     }
-                    if (highlightHelper.highlightOnly(toHighlight)) {
-                        Main.map.mapView.repaint();
-                    }
+                    SwingUtilities.invokeLater(new Runnable() {
+                        @Override
+                        public void run() {
+                            if (highlightHelper.highlightOnly(toHighlight)) {
+                                Main.map.mapView.repaint();
+                            }
+                        }
+                    });
                 }
-            }});
+            }};
+    
+    private void initHighlighting() {
+        getMemberTableModel().getSelectionModel().addListSelectionListener(highlighterListener);
         if (Main.isDisplayingMapView()) {
             HighlightHelper.clearAllHighlighted();
@@ -200,5 +208,14 @@
         super.unlinkAsListener();
         MapView.removeLayerChangeListener(zoomToGap);
-        highlightHelper.clear();
+    }
+    
+    public void stopHighlighting() {
+        if (highlighterListener == null) return;
+        getMemberTableModel().getSelectionModel().removeListSelectionListener(highlighterListener);
+        highlighterListener = null;
+        if (Main.isDisplayingMapView()) {
+            HighlightHelper.clearAllHighlighted();
+            Main.map.mapView.repaint();
+        }
     }
 
Index: /trunk/src/org/openstreetmap/josm/gui/util/HighlightHelper.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/util/HighlightHelper.java	(revision 6037)
+++ /trunk/src/org/openstreetmap/josm/gui/util/HighlightHelper.java	(revision 6038)
@@ -48,5 +48,5 @@
             needsRepaint |= setHighlight(p, true);
         }
-        //return true;
+
         return needsRepaint;
     }
