diff --git a/src/main-process/atom-application.js b/src/main-process/atom-application.js index 7f623aa90..168dfa682 100644 --- a/src/main-process/atom-application.js +++ b/src/main-process/atom-application.js @@ -838,10 +838,12 @@ class AtomApplication extends EventEmitter { }) } - // Returns the {AtomWindow} for the given paths. - windowForPaths (pathsToOpen, devMode) { - return this.getAllWindows().find(window => - window.devMode === devMode && window.containsPaths(pathsToOpen) + // Returns the {AtomWindow} for the given locations. + windowForLocations (locationsToOpen, devMode, safeMode) { + return this.getLastFocusedWindow(window => + window.devMode === devMode && + window.safeMode === safeMode && + window.containsLocations(locationsToOpen) ) }