Sometimes an application has other windows open, like the open
panel. Even when these are closed they seem to live on in the
application's window array. We now ignore those windows when trying
to terminate the app.
Closes#534
The first call to terminate is canceled so that every window can be
closed. On AtomCefClient the OnBeforeClose method is called when a
browser is finished closing. Once all windows have finished closing, AtomCefClient calls terminate again, which will terminate the
application.
Closes#527
Previously if the --dev flag was used and no resource was
specified or found in ~/github/atom then the app would
crash trying to add a null resource path to the node paths
list.
Now the bundle resource path is the fallback whenever the
dev resource path cannot be found or does not exist.
Previously isDevMode was returning true when it was called
before the resource path was initially set forcing Atom to
always run in dev mode.
Now we just use the new isDevFlagSpecified() method to check
where the bundle resource path should be used.
Previously Atom would crash if a path was opened when there
was already a window open that did not have a path, such as
the specs window.
Now window controllers without a path are skipped during the
checks to activate an existing window for an opened path.
Previously CefShutdown() was called after closing the windows
which would prevent them from running their beforeunload callbacks
and saving state properly when cmd-Q the application.
Now the number of open browsers is tracked and the message loop
is quit and the windows are autoreleased only after the browser
is ready to be closed.
Closes#493
Also return a subscription that can be unwatched instead
of returning an id that is later passed to $native.unwatchPath
along with the watched path.
This allows specs to pass when run from a symlink'ed folder.
Node uses the location of index as a starting point when looking for
node_modules. Previously, we always loaded index.html out of the app
bundle, which caused us to always load node_modules from the app
bundle as well, which is not what we want in dev mode. Since we no
longer depend on a compiled require.js, it's just as easy to load
index.html from the repository path when in dev mode.
fs-utils.absolute() now recreates the same behavior
but instead using fs.readpathSync().
This brings over the same behavior for special handling
the /private directory for now.