Commit Graph

52 Commits

Author SHA1 Message Date
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
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
Wliu
6cd480b37e Fix Electron deprecations 2015-11-17 21:16:09 -05:00
Nathan Sobo
3b2c6afdaf Fix removeListener calls 2015-11-17 16:23:38 -08:00
Nathan Sobo
badba2810e Add disablePinchToZoom to ApplicationDelegate 2015-10-16 11:08:52 -06:00
Max Brunsfeld
93fe0208a5 Make atom.setSize() synchronous again, for now
This method is public, and a spec for TextEditorComponent dependend on it
staying synchronous
2015-10-15 15:12:57 -07:00
Nathan Sobo
28ed6f3d9f Restore async window method calls
Signed-off-by: Max Brunsfeld <maxbrunsfeld@github.com>
2015-10-15 13:26:30 -06:00
Antonio Scandurra
c5860ce6b6 🐛 Fix typo 2015-10-14 12:59:22 +02:00
Nathan Sobo
20e07649d4 Move confirm into ApplicationDelegate
Signed-off-by: Max Brunsfeld <maxbrunsfeld@github.com>
2015-10-13 18:09:35 -06:00
Nathan Sobo
cc0bf23f78 Add setRepresentedDirectoryPaths to ApplicationDelegate
Also, use it to provide the default path in showSaveDialog
2015-10-13 17:57:48 -06:00
Nathan Sobo
919571f328 Use ApplicationDelegate in WindowEventHandler
Signed-off-by: Max Brunsfeld <maxbrunsfeld@github.com>
2015-10-13 17:29:41 -06:00