   #   :devMode - Boolean to control the opened window's dev mode.
   #   :safeMode - Boolean to control the opened window's safe mode.
   #   :windowDimensions - Object with height and width keys.
-  openPath: ({pathToOpen, pidToKillWhenClosed, newWindow, devMode, safeMode, windowDimensions}={}) ->
+  #   :window - {AtomWindow} to open file paths in.
+  openPath: ({pathToOpen, pidToKillWhenClosed, newWindow, devMode, safeMode, windowDimensions, window}={}) ->
     {pathToOpen, initialLine, initialColumn} = @locationForPathToOpen(pathToOpen)
 
     # Open files in the focused window
     unless pidToKillWhenClosed or newWindow
       if fs.statSyncNoException(pathToOpen).isFile?()
-        existingWindow = @topWindow
+        existingWindow = window ? @topWindow
 
       existingWindow ?= @windowForPath(pathToOpen) unless devMode
 

    for atomWindow in @windows
      return atomWindow if atomWindow.containsPath(pathToOpen)

  # Public: Returns the currently focused {AtomWindow} or undefined if none.
  focusedWindow: ->
    _.find @windows, (atomWindow) -> atomWindow.isFocused()


    # A request from the associated render process to open a new render process.
    ipc.on 'open', (event, options) =>
      window = @windowForEvent(event)
      if options?
        if options.pathsToOpen?.length > 0
          options.window = window
          @openPaths(options)
        else
          new AtomWindow(options)
      else
        @promptForPath({window})

    ipc.on 'update-application-menu', (event, template, keystrokesByCommand) =>
      @applicationMenu.update(template, keystrokesByCommand)
