Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java	(revision 1879)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java	(revision 1880)
@@ -175,5 +175,17 @@
         super(tr("Layers"), "layerlist", tr("Open a list of all loaded layers."),
                 Shortcut.registerShortcut("subwindow:layers", tr("Toggle: {0}", tr("Layers")), KeyEvent.VK_L, Shortcut.GROUP_LAYER), 100);
-        instance = new JList(model);
+        instance = new JList(model) {
+            @Override
+            protected void processMouseEvent(MouseEvent e) {
+                // if the layer list is embedded in a detached dialog, the last row is
+                // is selected if a user clicks in the empty space *below* the last row.
+                // This mouse event filter prevents this.
+                //
+                int idx = locationToIndex(e.getPoint());
+                if (getCellBounds(idx, idx).contains(e.getPoint())) {
+                    super.processMouseEvent(e);
+                }
+            }
+        };
         listScrollPane = new JScrollPane(instance);
         add(listScrollPane, BorderLayout.CENTER);
