In order to test changes to main.js, we need to rebuild the application.
For this reason, it makes sense to do as little work as possible here.
In this commit, we change main to just determine the resourcePath, then
use that path to require a start function which can be iterated on in
dev mode.
Signed-off-by: Max Brunsfeld <maxbrunsfeld@github.com>
Serialization still occurs when deactivating a single package via the
API. Otherwise, when the window is closed or reloaded we will serialize
all packages as a result of saving the window state.
Signed-off-by: Max Brunsfeld <maxbrunsfeld@github.com>
...because content could get reflowed and previous measurements might
become inaccurate. Typically, this could occur when measuring while the
editor is hidden: in that case, the yardstick would always report `0px`
and save that position into the cache. Then, when the editor becomes
visible again, the wrong `0px` value would be returned, thus causing
cursors etc. to be displayed incorrectly.
This was being shadowed by a bug in our measurements cache, but after
fixing it in #12730 it started becoming evident.
This performs restarts in the main process and uses ipc to request restarts from application windows. We preserve the following settings:
* dev mode
* custom resource path
* safe mode
* portable mode
* socket path
* log file path
* user data dir
Previously we were ignoring the measurement cache for characters located
at `left: 0px` because `0` is evaluated as falsy in Javascript, causing
those character to be constantly re-measured.
This commit fixes it so that we explicitly check for null values when
consulting the cache.
Since spec windows don't register handlers for the IPC messages requested window state to be saved, the promise never resolves and the close button needs to be clicked twice. To avoid this, we'll just resolve the promise immediately in a spec window so we can proceed to close it.
This regression was caused by a nuance in the way we maintain state in
`AtomApplication` for open windows. Specifically, when closing the last
window on Windows and Linux, we were explicitly calling `app.quit`
*before* removing such window from the list of open ones. In turn, this
caused the new `before-quit` behavior introduced in #12619 to work
improperly because it made the application wait on saving the state of a
stale window before exiting.
With this commit we are fixing that by making sure the stale window is
removed before calling `app.quit` in `removeWindow`.