Commit Graph

64 Commits

Author SHA1 Message Date
Michelle Tilley
5e43084cd3 url -> URI 2017-10-17 15:23:10 -07:00
Michelle Tilley
9e74e164b6 Merge remote-tracking branch 'origin/master' into mkt-url-based-command-dispatch 2017-09-18 16:49:12 -07:00
simurai
915e886711 Merge branch 'master' into sm-native-tabs 2017-08-24 13:52:52 +09:00
Damien Guard
269623c9ba Update loadSettingsJSON when paths change, fixed #13933 2017-07-11 20:46:09 -07:00
Damien Guard
68b7bf46dd Make loadSettings a property so we can change it 2017-07-11 17:04:54 -07:00
TJ Kohli
5524aca461 Improved clarity of Editor not responding actions
Changed "Close" to "Force Close" because "Close" might imply closing the Alert/Dialog instead of the editor, whereas "Force Close" better describes the action that button will take.
2017-06-10 19:30:52 -04:00
simurai
b854edef07 Enable native tabs on macOS 2017-06-03 15:54:53 +09:00
Max Brunsfeld
d289ca4471 Fix unintended unload prevention for spec windows 2017-06-02 10:30:10 -07:00
Max Brunsfeld
dc320181fc Fix handling of .save and .saveAs rejections
* Make Pane.close, Pane.saveActiveItem, and Pane.saveActiveItemAs async.
* Refactor the logic for prompting to save on window unload
2017-05-31 17:46:04 -07:00
Antonio Scandurra
729ae0ea51 Merge branch 'master' into tj-upgrade-electron
# Conflicts:
#	script/package.json
#	src/task.coffee
2017-05-11 18:05:12 +02:00
Antonio Scandurra
ce81ac6201 Disable zoom only after the window has finished loading 2017-05-04 13:50:17 +02:00
Antonio Scandurra
d9004769e0 Disable auxclick 2017-05-03 14:21:24 +02:00
Wliu
d5c13d15bf setZoomLevelLimits -> setVisualZoomLevelLimits 2017-05-03 14:21:23 +02:00
Wliu
c005f7564a Remove unneeded backgroundColor 2017-05-03 14:21:23 +02:00
Hong Chen
89dae42092 Fix issue https://github.com/atom/atom/issues/14109 and https://github.com/atom/atom/issues/13978
First argument to dialog.showSaveDialog() needs to be a BrowserWindow

https://github.com/electron/electron/blob/master/docs/api/dialog.md
https://github.com/electron/electron/blob/master/lib/browser/api/dialog.js
2017-04-03 20:47:36 +08:00
Michelle Tilley
cc2cbfbb0a Emit event from AtomWindow when locations are loaded 2017-03-23 23:36:53 -07: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
Antonio Scandurra
051e27dbcb Expose load settings to BrowserWindows as JSON
When accessing objects in the main process via the `remote` module,
Electron returns proxy objects that are references to the original ones.
This means that trying to access a remote object's property or function
results in a synchronous message exchange with the main process.

In Atom core we frequently access the load settings coming from the main
process, especially during startup. This caused a lot of synchronous I/O
which was blocking the renderer process for several milliseconds.

With this commit, instead of exposing load settings as a JavaScript
object, we serialize them to JSON in the main process and parse them
back to a JavaScript object in the renderer processes. This allows us to
get a full copy of the object locally and pay for I/O just once when
retrieving load settings from the main process for the first time.
2017-03-07 10:54:42 +01:00
simurai
ec9aec6686 Merge branch 'master' into sm-custom-title-bar 2017-02-21 21:56:53 +09:00
Max Brunsfeld
aea6896c2b Restore correct directory's project state when opening a new file from the command line 2017-02-13 17:23:11 -08: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
simurai
6010c4d7df Add custom-inset title-bar 2017-01-14 16:06:50 +09:00
simurai
c406cc4420 Merge branch 'master' into sm-hidden-all 2017-01-14 10:09:07 +09:00
Michelle Tilley
05f58a432b Ensure a dialog is not opened when webContents crash in headless mode 2017-01-12 14:45:38 -08:00
Antonio Scandurra
8e6cef458c Revert "Flush DOM before displaying context menu" 2016-12-06 17:29:49 +01:00
Antonio Scandurra
eb0b48ffe0 🎨 2016-12-06 12:10:58 +01:00
Christopher Chedeau
cd781b9f9d Flush DOM before displaying context menu
Released under CC0
2016-11-28 19:03:32 -08:00
simurai
2571bbc6f2 Merge branch 'master' into sm-hidden-inset
# Conflicts:
#	src/main-process/atom-application.coffee
2016-10-15 19:45:50 +09:00
simurai
ed2c72a586 Add option to hide the title bar 2016-10-15 19:12:53 +09:00
Indrek Ardel
55f3311c01 Remove unused variables 2016-09-26 20:52:13 +03:00
simurai
e7f204053a 🎨 2016-09-24 16:05:33 +09: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
50128949d4 Call window methods on AtomWindow when ipc'ing from render process
This enables saveState to be called when requesting a window reload from the render process.

Signed-off-by: Max Brunsfeld <maxbrunsfeld@github.com>
2016-09-22 11:41:57 -06:00
Max Brunsfeld
3039024d17 Go back to using promise based on window:loaded event in main process tests 2016-09-21 11:37:24 -07:00
simurai
a4435305f1 Merge branch 'master' into pb-hidden-inset
# Conflicts:
#	src/main-process/atom-window.coffee
2016-09-21 14:48:22 +09:00
Max Brunsfeld
833b3b0ab0 Save state when reloading AtomWindow
Signed-off-by: Nathan Sobo <nathan@github.com>
2016-09-20 16:10:11 -07:00
Max Brunsfeld
30fdb70dfd Initialize app-started promise before reloading AtomWindow 2016-09-20 09:53:54 -07:00
Nathan Sobo
7bba3e86b2 Try this on travis 2016-09-16 16:47:33 -06:00
Nathan Sobo
212cb0df34 Resolve AtomWindow.reload promise once window fully starts 2016-09-16 14:33:30 -06:00
Nathan Sobo
5fad2bdbf9 Return a promise from AtomWindow.reload that resolves on window:loaded 2016-09-16 14:10:34 -06:00
Nathan Sobo
0ff0b269b1 Don't wait for spec windows to save state
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.
2016-09-12 10:26:40 -06:00
Antonio Scandurra
34a99f9c82 Write tests to ensure quitting the application works as expected 2016-09-07 14:18:52 +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
dbfd0cc605 Move integration test of window persistence to main process tests 2016-08-11 15:28:11 -06:00
Nathan Sobo
6994060e72 Use fat arrow where it is needed 2016-08-11 14:31:23 -06:00
Nathan Sobo
502339b830 Replace chromedriver test of window offset with main process mocha test
Signed-off-by: Antonio Scandurra <as-cii@github.com>
2016-08-11 10:33:12 -06:00
Nathan Sobo
c1b2042bcc 🎨 2016-08-02 16:19:38 -06:00
Philipp Brumm
76357473ad call setSheetOffset on onDidChangeActiveThemes 2016-07-13 14:59:37 +02:00
Philipp Brumm
08a358228b move title bar setting check into method and check for isSpec as well 2016-07-06 14:22:17 +02:00