Index: trunk/src/org/openstreetmap/josm/actions/JosmAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/JosmAction.java	(revision 5983)
+++ trunk/src/org/openstreetmap/josm/actions/JosmAction.java	(revision 5984)
@@ -18,4 +18,5 @@
 import org.openstreetmap.josm.gui.layer.Layer;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
+import org.openstreetmap.josm.gui.util.GuiHelper;
 import org.openstreetmap.josm.tools.Destroyable;
 import org.openstreetmap.josm.tools.ImageProvider;
@@ -223,14 +224,21 @@
      */
     private class LayerChangeAdapter implements MapView.LayerChangeListener {
+        private void updateEnabledStateInEDT() {
+            GuiHelper.runInEDT(new Runnable() {
+                @Override public void run() {
+                    updateEnabledState();
+                }
+            });
+        }
         public void activeLayerChange(Layer oldLayer, Layer newLayer) {
-            updateEnabledState();
+            updateEnabledStateInEDT();
         }
 
         public void layerAdded(Layer newLayer) {
-            updateEnabledState();
+            updateEnabledStateInEDT();
         }
 
         public void layerRemoved(Layer oldLayer) {
-            updateEnabledState();
+            updateEnabledStateInEDT();
         }
     }
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java	(revision 5983)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java	(revision 5984)
@@ -66,4 +66,5 @@
 import org.openstreetmap.josm.gui.SideButton;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
+import org.openstreetmap.josm.gui.util.GuiHelper;
 import org.openstreetmap.josm.gui.widgets.ListPopupMenu;
 import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher;
@@ -128,4 +129,7 @@
     }
 
+    /**
+     * Constructs a new {@code SelectionListDialog}.
+     */
     public SelectionListDialog() {
         super(tr("Selection"), "selectionlist", tr("Open a selection list window."),
@@ -219,4 +223,8 @@
     }
 
+    /**
+     * Replies the selected OSM primitives.
+     * @return The selected OSM primitives
+     */
     public Collection<OsmPrimitive> getSelectedPrimitives() {
         return model.getSelected();
@@ -484,14 +492,4 @@
 
         /**
-         * Replies the collection of OSM primitives in the view
-         * of this model
-         *
-         * @return complete content of the view
-         */
-        public Collection<OsmPrimitive> getAllElements() {
-            return selection;
-        }
-
-        /**
          * Sets the OSM primitives to be selected in the view of this model
          *
@@ -521,26 +519,30 @@
          * @param selection the collection of currently selected OSM objects
          */
-        public void setJOSMSelection(Collection<? extends OsmPrimitive> selection) {
+        public void setJOSMSelection(final Collection<? extends OsmPrimitive> selection) {
             this.selection.clear();
-            if (selection == null) {
-                fireContentsChanged(this, 0, getSize());
-                return;
-            }
-            this.selection.addAll(selection);
-            sort();
-            fireContentsChanged(this, 0, getSize());
-            remember(selection);
-            double dist = -1;
-            SubclassFilteredCollection<OsmPrimitive, Way> ways = new SubclassFilteredCollection<OsmPrimitive, Way>(selection, OsmPrimitive.wayPredicate);
-            // Compute total length of selected way(s) until an arbitrary limit set to 250 ways
-            // in order to prevent performance issue if a large number of ways are selected (old behaviour kept in that case, see #8403)
-            int maxWays = Math.max(1, Main.pref.getInteger("selection.max-ways-for-statusline", 250));
-            if (!ways.isEmpty() && ways.size() <= maxWays) {
-                dist = 0.0;
-                for (Way w : ways) {
-                    dist += w.getLength();
+            if (selection != null) {
+                this.selection.addAll(selection);
+                sort();
+            }
+            GuiHelper.runInEDTAndWait(new Runnable() {
+                @Override public void run() {
+                    fireContentsChanged(this, 0, getSize());
+                    if (selection != null) {
+                        remember(selection);
+                        double dist = -1;
+                        SubclassFilteredCollection<OsmPrimitive, Way> ways = new SubclassFilteredCollection<OsmPrimitive, Way>(selection, OsmPrimitive.wayPredicate);
+                        // Compute total length of selected way(s) until an arbitrary limit set to 250 ways
+                        // in order to prevent performance issue if a large number of ways are selected (old behaviour kept in that case, see #8403)
+                        int maxWays = Math.max(1, Main.pref.getInteger("selection.max-ways-for-statusline", 250));
+                        if (!ways.isEmpty() && ways.size() <= maxWays) {
+                            dist = 0.0;
+                            for (Way w : ways) {
+                                dist += w.getLength();
+                            }
+                        }
+                        Main.map.statusLine.setDist(dist);
+                    }
                 }
-            }
-            Main.map.statusLine.setDist(dist);
+            });
         }
 
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java	(revision 5983)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java	(revision 5984)
@@ -85,4 +85,5 @@
 import org.openstreetmap.josm.gui.tagging.TaggingPreset;
 import org.openstreetmap.josm.gui.tagging.TaggingPreset.PresetType;
+import org.openstreetmap.josm.gui.util.GuiHelper;
 import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher;
 import org.openstreetmap.josm.tools.GBC;
@@ -683,6 +684,9 @@
         if (newLayer == null) editHelper.saveTagsIfNeeded();
         // it is time to save history of tags
-            
-        updateSelection();
+        GuiHelper.runInEDT(new Runnable() {
+            @Override public void run() {
+                updateSelection();
+            }
+        });
     }
 
