From cc1ddf10115fd264fe17b27206dd26e1ab35f2e3 Mon Sep 17 00:00:00 2001 From: Ash Wilson Date: Fri, 19 Apr 2019 15:50:03 -0400 Subject: [PATCH] Use hasOpenFiles to flag a window that will receive openLocations() --- spec/main-process/atom-window.test.js | 1 + src/main-process/atom-window.js | 2 ++ 2 files changed, 3 insertions(+) diff --git a/spec/main-process/atom-window.test.js b/spec/main-process/atom-window.test.js index 12a8abd11..af5442fe7 100644 --- a/spec/main-process/atom-window.test.js +++ b/spec/main-process/atom-window.test.js @@ -255,6 +255,7 @@ describe('AtomWindow', function () { const w = new AtomWindow(app, service, { browserWindowConstructor: StubBrowserWindow, locationsToOpen }) assert.deepEqual(w.projectRoots, ['directory0', 'directory1']) + assert.isTrue(w.loadSettings.hasOpenFiles) assert.deepEqual(w.loadSettings.initialProjectRoots, ['directory0', 'directory1']) assert.isTrue(w.hasProjectPaths()) }) diff --git a/src/main-process/atom-window.js b/src/main-process/atom-window.js index 2bc42dd8e..a28f5559a 100644 --- a/src/main-process/atom-window.js +++ b/src/main-process/atom-window.js @@ -77,6 +77,8 @@ class AtomWindow extends EventEmitter { .map(location => location.pathToOpen) this.projectRoots.sort() + this.loadSettings.hasOpenFiles = locationsToOpen + .some(location => location.pathToOpen && !location.isDirectory) this.loadSettings.initialProjectRoots = this.projectRoots // Only send to the first non-spec window created