Index: trunk/src/org/openstreetmap/josm/Main.java
===================================================================
--- trunk/src/org/openstreetmap/josm/Main.java	(revision 10411)
+++ trunk/src/org/openstreetmap/josm/Main.java	(revision 10412)
@@ -83,4 +83,5 @@
 import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.gui.MapFrameListener;
+import org.openstreetmap.josm.gui.MapView;
 import org.openstreetmap.josm.gui.dialogs.LayerListDialog;
 import org.openstreetmap.josm.gui.help.HelpUtil;
@@ -526,6 +527,12 @@
         Main.map = map;
 
+        // Notify map frame listeners, mostly plugins.
+        if ((map == null) == (old == null)) {
+            Main.warn("Replacing the map frame. This is not expected by some plugins and should not happen.");
+        }
         for (MapFrameListener listener : mapFrameListeners) {
+            MapView.fireDeprecatedListenerOnAdd = true;
             listener.mapFrameInitialized(old, map);
+            MapView.fireDeprecatedListenerOnAdd = false;
         }
         if (map == null && currentProgressMonitor != null) {
Index: trunk/src/org/openstreetmap/josm/gui/MapView.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MapView.java	(revision 10411)
+++ trunk/src/org/openstreetmap/josm/gui/MapView.java	(revision 10412)
@@ -375,5 +375,9 @@
     @Deprecated
     public static void addLayerChangeListener(LayerChangeListener listener) {
-        addLayerChangeListener(listener, false);
+        if (fireDeprecatedListenerOnAdd) {
+            Main.warn("Plugin seems to be adding listener during mapFrameInitialized(): " + BugReport.getCallingMethod(2)
+            + ". Layer listeners should be set on plugin load.");
+        }
+        addLayerChangeListener(listener, fireDeprecatedListenerOnAdd);
     }
 
@@ -391,8 +395,8 @@
     public static void addLayerChangeListener(LayerChangeListener listener, boolean initialFire) {
         if (listener != null) {
-            initialFire = initialFire && Main.isDisplayingMapView();
+            initialFire = initialFire && (Main.isDisplayingMapView() || fireDeprecatedListenerOnAdd);
 
             LayerChangeAdapter adapter = new LayerChangeAdapter(listener, initialFire);
-            Main.getLayerManager().addLayerChangeListener(adapter, false);
+            Main.getLayerManager().addLayerChangeListener(adapter, initialFire);
             if (initialFire) {
                 Main.getLayerManager().addAndFireActiveLayerChangeListener(adapter);
@@ -438,4 +442,14 @@
         addEditLayerChangeListener(listener, false);
     }
+
+
+    /**
+     * Temporary. To be removed as soon as the {@link LayerChangeListener}s are removed.
+     * <p>
+     * Some plugins add their listeners in {@link Main#setMapFrame(MapFrame)}. This method is now called just after the first layer was added to
+     * the layer manager. So that listener would not receive the addition of the first layer. As long as this field is set, we fake an add call
+     * to that listener when it is added to immitate the old behaviour. You should not access it from anywhere else.
+     */
+    public static boolean fireDeprecatedListenerOnAdd;
 
     public boolean viewportFollowing;
Index: trunk/src/org/openstreetmap/josm/tools/bugreport/BugReport.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/bugreport/BugReport.java	(revision 10411)
+++ trunk/src/org/openstreetmap/josm/tools/bugreport/BugReport.java	(revision 10412)
@@ -63,5 +63,5 @@
      * @return The method name.
      */
-    static String getCallingMethod(int offset) {
+    public static String getCallingMethod(int offset) {
         StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
         String className = BugReport.class.getName();
