Commit Graph

61 Commits

Author SHA1 Message Date
Antonio Scandurra
1e040c62d9 Add AtomEnvironment.prototype.resolveProxy(url)
This new private API will allow settings-view to communicate
asynchronously with the main process to resolve proxies, instead of
using `remote` and blocking the renderer process during startup.
2017-03-10 16:08:02 +01:00
Antonio Scandurra
45d41ca69f Register enter/leave fullscreen events in the main process
This will still notify render processes when such events are triggered
without, however, incurring the additional cost of synchronously
retrieving a `BrowserWindow` (and its properties) via `remote` during
startup.
2017-03-07 10:54:42 +01:00
Antonio Scandurra
727472af58 Disable zoom in the main process
This commit will register the `display-added` and `display-removed`
events only once in the main process in order to disable zoom (see
https://github.com/atom/atom/pull/11345) directly instead of
unnecessarily paying for I/O in the renderer process during startup.
2017-03-07 10:54:42 +01:00
Nathan Sobo
c6cae5b8fd Store represented directory paths directly on AtomWindow in main process
Fixes #13729

Previously, when adding a window, we were unable to read its current
project paths out of the hash of the URL during window initialization
because the window still considered itself to be loading. Rather than
fixing this issue, we decided to completely eliminate the sharing of
state between processes in the window.location and instead switch to
cached synchronous RPC for the loadSettings and a dedicated RPC-based
mechanism for the project paths.
2017-02-07 13:15:27 -07:00
Vladimir Timofeev
a21841e5f3 Merge commit '1320ff28c39afd563820b30b43389ea38552e74c' into fix-12495 2017-01-07 01:19:50 +03:00
Damien Guard
8229924b96 History API, reopen project menu, command and list view 2016-10-21 15:13:59 -07:00
Indrek Ardel
55f3311c01 Remove unused variables 2016-09-26 20:52:13 +03:00
Nathan Sobo
3a4ae04f74 Use call/respondTo helpers to return a promise from window method ipcs
Signed-off-by: Max Brunsfeld <maxbrunsfeld@github.com>
2016-09-22 12:18:09 -06:00
Nathan Sobo
fe9a7d1db3 Preserve command line flags when restarting
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
2016-09-20 15:13:46 -06:00
Nathan Sobo
6aa8d33a05 Add atom.restartApplication
Signed-off-by: Max Brunsfeld <maxbrunsfeld@github.com>
2016-09-20 11:37:34 -06:00
Antonio Scandurra
e6c15ee10b onSaveWindowState -> onSaveWindowStateRequest 2016-09-07 15:47:23 +02:00
Antonio Scandurra
0f6eadcfce Wait for windows' state to be saved before closing the app or any window
Previously, we used to save the window's state in the renderer process
`beforeunload` event handler: because of the synchronous nature of event
handlers and the asynchronous design of IndexedDB, this could
potentially not save anything if windows close fast enough to prevent
IndexedDB from committing the pending transaction containing the state.
(Ref.: https://mzl.la/2bXCXDn)

With this commit, we will intercept the `before-quit` events on
`electron.app` and the `close` event on `BrowserWindow` (which will fire
respectively before quitting the application and before closing a
window), and prevent them from performing the default action. We will
then ask each renderer process to save its state and, finally, close the
window and/or the app.
2016-09-07 13:03:33 +02:00
yuanwhy
1320ff28c3 delete empty line 2016-08-30 23:00:20 +08:00
yuanwhy
1c1640c1d8 rename to did-change-paths 2016-08-30 20:29:05 +08:00
yuanwhy
4e0da56296 send event to save state after 'Add Project Folder' or 'Remove Project Folder 2016-08-29 22:52:26 +08:00
Nathan Sobo
dfc0910023 Stringify/parse temporary window state to avoid nulling out references
If the object passed via IPC contains any keys of the same reference,
all but one of these keys will be nulled out. Converting to/from a
string avoids this problem.
2016-08-09 14:43:38 -06:00
Zirro
04b8bd03ae Introduce a non-explicit getUserDefault-method 2016-08-05 21:40:34 +02:00
Zirro
24befe2454 Handle double-click on custom title bar 2016-08-04 23:11:22 +02:00
Antonio Scandurra
b84feeb853 Emit {will,did}SavePath events synchronously 2016-05-25 00:11:30 +02:00
Antonio Scandurra
ef3ab03d28 Emit {will,did}SavePath on ipcMain before/after a buffer is saved 2016-05-23 18:37:26 +02:00
Antonio Scandurra
793f5f9692 Disable zoom every time a display gets added or removed 2016-04-01 16:04:01 +02:00
Antonio Scandurra
158d019371 Use application-level events to control updates in the browser process 2016-04-01 10:56:30 +02:00
Antonio Scandurra
4d4ee6bf3b Add applicationDelegate.getAutoUpdateManagerErrorMessage()
Sometimes, the error event gets emitted before the renderer process has
the chance to subscribe. Therefore, we expose an
`autoUpdateManager.getErrorMessage()` in the browser process, so that we
don’t lose that information.
2016-03-31 10:16:11 +02:00
Antonio Scandurra
2d5e697016 Add AutoUpdateManager.prototype.onUpdateError 2016-03-30 15:05:57 +02:00
Ben Ogle
492e89c8ff Move raw ipc calls into the applicationDelegate 2016-03-01 15:09:05 -08:00
Ben Ogle
8eb1326d4c Add some TODOs 2016-03-01 15:09:04 -08:00
Ben Ogle
ddff53bfc5 Postfix ifs 2016-03-01 15:07:56 -08:00
Katrina Uychaco
3e29cd5762 Merge branch 'master' into dh-expose-updates 2016-03-01 15:07:12 -08:00
Daniel Hengeveld
a8a5006950 Add missing subscription event 2016-03-01 15:07:12 -08:00
Daniel Hengeveld
1eaf30fae9 Add a few more things before stepping aside to work on another issue
…maybe rebase this away…
2016-03-01 15:06:33 -08:00
Daniel Hengeveld
3716aaf00b Spike out an update wrapper
We can expose just a few event subscription methods on atom.update to
take care of what most packages (e.g. About) would be interested in. Of
course the updater runs on the main thread so we’re proxying them
through IPC. It’s fine.
2016-03-01 15:06:33 -08:00
Max Brunsfeld
43656a9861 Load packages before deserializing state 2016-02-18 09:17:34 -08:00
Max Brunsfeld
32f5149196 Wait for browser process to acknowledge window manipulation IPC requests
We need to avoid using the  module for synchronous IPC on startup, but
in some cases, we need to know when our asynchronous IPC messages have taken
effect. Now,  methods like  and
return Promises that indicate when the message has been processed.
2016-01-27 12:59:24 -08:00
Wliu
ed96ac7daf browserWindow.restart -> .reload 2015-12-12 21:35:14 -05:00
Cheng Zhao
2e5c7f8573 executeJavaScriptInDevTools is deprecated 2015-12-11 11:00:08 +08:00
Cheng Zhao
2150790596 Use the new style of remote 2015-12-11 10:21:46 +08:00
Cheng Zhao
1f9cfc929c Update the API usages after merge 2015-12-11 09:50:18 +08:00
Cheng Zhao
f6e889aeb2 Merge branch 'master' into wl-electron-35 2015-12-11 09:32:32 +08:00
Cheng Zhao
1725b9bf54 Use require('electron') 2015-12-11 09:30:58 +08:00
Douwe Maan
948aaa0652 Add opened files and folders to recent documents menu 2015-12-01 11:07:10 +01:00
Wliu
71574d785c Merge remote-tracking branch 'master' into wl-electron-35
# Conflicts:
#	package.json
#	src/application-delegate.coffee
2015-11-25 18:44:40 -05:00
Antonio Scandurra
7bd62790d2 📝 2015-11-24 14:02:34 +01:00
Antonio Scandurra
b3738cfc34 Interact with DevTools on process.nextTick
Using any of the DevTools synchronous methods causes the bad character input
issue.
2015-11-24 12:51:13 +01:00
Antonio Scandurra
6b5ef9a0aa 🔥 2015-11-24 12:45:15 +01:00
Antonio Scandurra
9e931b15c3 Switch to a Promise-based version of DevTools interaction 2015-11-24 12:21:16 +01:00
Antonio Scandurra
9655d8184e Interact with DevTools asynchronously 2015-11-24 11:43:09 +01:00
Wliu
c85cd80544 Fix missing parentheses 2015-11-19 19:49:29 -05:00
Wliu
50a42af9fd ...try this? 2015-11-19 18:20:51 -05:00
Wliu
fec1507ff4 Require ipc-renderer where it belongs 2015-11-18 21:10:40 -05:00
Wliu
0945383d78 Merge remote-tracking branch 'refs/remotes/origin/master' into wl-electron-35 2015-11-18 16:11:49 -05:00