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
..
2016-08-15 17:12:40 -07:00
2016-09-07 13:03:33 +02:00
2016-08-26 15:13:37 +02:00
2016-08-09 14:43:38 -06:00
2016-08-12 16:16:09 -06:00
2016-09-07 13:03:33 +02:00
2016-05-25 11:02:29 +02:00
2015-09-18 20:48:50 -06:00
2016-08-02 17:40:26 -07:00
2016-06-18 15:33:08 +02:00
2016-02-18 15:09:22 -08:00
2016-01-15 14:35:28 -06:00
2016-05-03 15:22:13 -07:00
2014-02-03 13:20:28 -08:00
2015-11-11 12:05:11 -07:00
2016-05-01 16:48:09 -07:00
2016-06-17 11:04:08 +02:00
2016-03-08 10:20:37 +01:00
2016-08-25 22:44:57 -04:00
2015-10-07 15:25:02 -05:00
2016-04-05 18:43:08 +02:00
2016-01-15 14:35:28 -06:00
2016-01-15 14:35:28 -06:00
2014-09-30 12:58:10 -06:00
2015-10-06 10:02:04 +02:00
2016-03-25 16:37:01 +01:00
2016-01-05 19:55:53 +01:00
2015-10-07 15:25:05 -05:00
2016-08-06 07:00:24 -06:00
2016-07-29 13:42:09 -07:00
2015-10-07 15:25:02 -05:00
2015-08-21 12:55:22 -07:00
2015-04-22 07:29:00 -07:00
2016-04-14 15:46:50 +02:00
2016-08-15 16:45:10 -07:00
2016-05-01 11:05:14 +02:00
2015-10-07 15:25:06 -05:00
2016-04-14 14:19:09 +00:00
2016-01-13 19:05:38 -08:00
2014-11-24 14:58:21 -08:00
2015-07-07 13:46:53 -07:00
2016-07-25 22:45:43 -07:00
2016-08-02 12:14:00 -07:00
2016-03-28 14:49:26 +02:00
2016-03-28 16:40:39 +02:00
2016-02-09 00:36:37 +01:00
2016-05-30 14:49:29 +02:00
2016-08-19 12:40:28 +02:00
2015-10-07 15:25:01 -05:00
2014-12-01 16:28:33 -08:00
2015-10-07 15:25:00 -05:00
2014-12-09 13:41:33 -07:00
2016-06-20 17:06:50 +02:00
2015-10-13 18:54:48 -06:00
2016-04-28 13:43:00 +02:00
2016-05-25 11:02:29 +02:00
2013-12-31 15:05:34 -08:00
2016-08-15 11:17:07 -07:00
2016-07-18 22:56:02 -07:00
2016-02-11 19:56:25 -08:00
2015-10-07 15:24:51 -05:00
2015-10-09 13:46:32 -07:00
2015-07-07 09:50:07 -07:00
2016-08-18 14:03:44 -06:00
2016-08-17 15:52:51 -06:00
2016-08-17 19:21:56 +02:00
2016-08-30 13:20:17 -07:00
2016-08-19 14:10:59 +02:00
2016-03-18 18:30:35 +01:00
2016-04-19 14:25:44 -07:00
2014-08-14 19:41:49 +02:00
2016-08-02 16:16:27 -06:00
2015-10-07 15:25:02 -05:00
2016-09-06 19:24:57 +02:00
2016-08-10 13:23:32 -07:00
2016-03-04 13:40:16 -07:00
2015-08-19 17:55:29 -07:00
2016-08-15 17:05:18 -07:00
2016-03-01 10:56:03 -05:00
2016-08-02 17:12:04 -06:00
2016-07-27 16:02:24 -07:00
2016-08-18 14:54:23 -05:00