             do {
                 let doc = try Document.init(contentsOf: fileURL, ofType: fileType)
 
-                if let hwc = (doc as NSDocument).windowControllers.first {
-                    hwc.window?.orderFront(self)
+                if let hwc = (doc as NSDocument).windowControllers.first, let window = hwc.window {
+                    if fromWindow != nil { window.offsetFromWindow(fromWindow!) }
+                    window.orderFront(self)
                     (hwc.contentViewController as! WebViewController).loadURL(url: fileURL)
                     status = true
                 }

        UserSettings.disabledMagicURLs.value = (sender.state == NSOnState)
    }
    
    fileprivate func doOpenFile(fileURL: URL) -> Bool {
        let dc = NSDocumentController.shared()
        let fileType = fileURL.pathExtension
        dc.noteNewRecentDocumentURL(fileURL)

                        dict["name"] = url.absoluteString
                    }
                    self.hiddenWindows[frame] = dict
//                    Swift.print("hide \(frame) to \(String(describing: alpha))")
                    win.alphaValue = 0.01
                }
            }
