Index: /applications/editors/josm/plugins/cadastre-fr/build.xml
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/build.xml	(revision 33225)
+++ /applications/editors/josm/plugins/cadastre-fr/build.xml	(revision 33226)
@@ -4,5 +4,5 @@
     <property name="commit.message" value="Changed constructor for Plugin"/>
     <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
-    <property name="plugin.main.version" value="10580"/>
+    <property name="plugin.main.version" value="11713"/>
     
     <!-- Configure these properties (replace "..." accordingly).
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/Address.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/Address.java	(revision 33225)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/Address.java	(revision 33226)
@@ -56,5 +56,4 @@
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.data.osm.WaySegment;
-import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.gui.MapView;
 import org.openstreetmap.josm.tools.GBC;
@@ -91,5 +90,8 @@
     private boolean ctrl;
 
-    public Address(MapFrame mapFrame) {
+    /**
+     * Constructs a new {@code Address} map mode.
+     */
+    public Address() {
         super(tr("Add address"), "buildings",
                 tr("Helping tool for tag address"),
@@ -97,5 +99,5 @@
                 Shortcut.registerShortcut("mapmode:cadastre-fr-buildings", tr("Mode: {0}", tr("CadastreFR - Buildings")), KeyEvent.VK_E, Shortcut.DIRECT),
                 // CHECKSTYLE.ON: LineLength
-                mapFrame, getCursor());
+                getCursor());
     }
 
@@ -114,5 +116,4 @@
             Main.map.mapView.removeMouseListener(this);
         }
-//        dialog.setVisible(false);
         // kill the window completely to fix an issue on some linux distro and full screen mode.
         if (dialog != null) {
@@ -510,5 +511,7 @@
             @Override
             public void windowClosing(WindowEvent arg) {
-                exitMode();
+                if (Boolean.TRUE.equals(getValue("active"))) {
+                    exitMode();
+                }
                 Main.map.selectMapMode((MapMode) Main.map.getDefaultButtonAction());
             }
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java	(revision 33225)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java	(revision 33226)
@@ -376,6 +376,6 @@
             if (oldFrame == null && newFrame != null) {
                 setEnabledAll(true);
-                Main.map.addMapMode(new IconToggleButton(new WMSAdjustAction(Main.map)));
-                Main.map.addMapMode(new IconToggleButton(new Address(Main.map)));
+                Main.map.addMapMode(new IconToggleButton(new WMSAdjustAction()));
+                Main.map.addMapMode(new IconToggleButton(new Address()));
             } else if (oldFrame != null && newFrame == null) {
                 setEnabledAll(false);
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSAdjustAction.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSAdjustAction.java	(revision 33225)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSAdjustAction.java	(revision 33226)
@@ -18,5 +18,4 @@
 import org.openstreetmap.josm.actions.mapmode.MapMode;
 import org.openstreetmap.josm.data.coor.EastNorth;
-import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.gui.MapView;
 import org.openstreetmap.josm.tools.ImageProvider;
@@ -34,7 +33,10 @@
     private static EastNorth[] croppedRaster = new EastNorth[5];;
 
-    public WMSAdjustAction(MapFrame mapFrame) {
+    /**
+     * Constructs a new {@code WMSAdjustAction} map mode.
+     */
+    public WMSAdjustAction() {
         super(tr("Adjust WMS"), "adjustxywms",
-                        tr("Adjust the position of the WMS layer (saved for raster images only)"), mapFrame,
+                        tr("Adjust the position of the WMS layer (saved for raster images only)"),
                         ImageProvider.getCursor("normal", "move"));
     }
@@ -50,7 +52,8 @@
                 modifiedLayer.adjustModeEnabled = true;
             } else {
-//                JOptionPane.showMessageDialog(Main.parent,tr("This mode works only if active layer is\n"
-//                        +"a cadastre layer"));
-                exitMode();
+                // This mode works only if active layer is a cadastre layer
+                if (Boolean.TRUE.equals(getValue("active"))) {
+                    exitMode();
+                }
                 Main.map.selectMapMode((MapMode) Main.map.getDefaultButtonAction());
             }
