Index: trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java	(revision 12838)
+++ trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java	(revision 12839)
@@ -6,4 +6,5 @@
 import static org.openstreetmap.josm.tools.I18n.trn;
 
+import java.awt.Component;
 import java.awt.Cursor;
 import java.awt.Dimension;
@@ -669,5 +670,5 @@
          * @param setting The setting used.
          */
-        void receiveSearchResult(DataSet ds, Collection<OsmPrimitive> result, int foundMatches, SearchSetting setting);
+        void receiveSearchResult(DataSet ds, Collection<OsmPrimitive> result, int foundMatches, SearchSetting setting, Component parent);
     }
 
@@ -678,5 +679,5 @@
 
         @Override
-        public void receiveSearchResult(DataSet ds, Collection<OsmPrimitive> result, int foundMatches, SearchSetting setting) {
+        public void receiveSearchResult(DataSet ds, Collection<OsmPrimitive> result, int foundMatches, SearchSetting setting, Component parent) {
             ds.setSelected(result);
             MapFrame map = MainApplication.getMap();
@@ -700,5 +701,5 @@
                 if (!GraphicsEnvironment.isHeadless()) {
                     JOptionPane.showMessageDialog(
-                            Main.parent,
+                            parent,
                             msg,
                             tr("Warning"),
@@ -721,5 +722,5 @@
         @Override
         public void receiveSearchResult(DataSet ds, Collection<OsmPrimitive> result, int foundMatches,
-                SearchSetting setting) {
+                SearchSetting setting, Component parent) {
                     this.result = result;
         }
@@ -826,5 +827,5 @@
                 return;
             }
-            resultReceiver.receiveSearchResult(ds, selection, foundMatches, setting);
+            resultReceiver.receiveSearchResult(ds, selection, foundMatches, setting, getProgressMonitor().getWindowParent());
         }
     }
