mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-13 08:44:12 +03:00
Merge pull request #7234 from atom/mb-keep-state-when-auto-updating
Avoid saving state when closing windows due to auto-update
This commit is contained in:
commit
6282e7e533
@ -105,7 +105,7 @@ class AtomApplication
|
||||
app.quit()
|
||||
return
|
||||
@windows.splice(@windows.indexOf(window), 1)
|
||||
@saveState() unless window.isSpec or @quitting
|
||||
@saveState() unless window.isSpec
|
||||
|
||||
# Public: Adds the {AtomWindow} to the global window list.
|
||||
addWindow: (window) ->
|
||||
@ -186,7 +186,10 @@ class AtomApplication
|
||||
@on 'application:report-issue', -> require('shell').openExternal('https://github.com/atom/atom/blob/master/CONTRIBUTING.md#submitting-issues')
|
||||
@on 'application:search-issues', -> require('shell').openExternal('https://github.com/issues?q=+is%3Aissue+user%3Aatom')
|
||||
|
||||
@on 'application:install-update', => @autoUpdateManager.install()
|
||||
@on 'application:install-update', =>
|
||||
@quitting = true
|
||||
@autoUpdateManager.install()
|
||||
|
||||
@on 'application:check-for-update', => @autoUpdateManager.check()
|
||||
|
||||
if process.platform is 'darwin'
|
||||
@ -270,6 +273,9 @@ class AtomApplication
|
||||
@promptForPath "folder", (selectedPaths) ->
|
||||
event.sender.send(responseChannel, selectedPaths)
|
||||
|
||||
ipc.on 'cancel-window-close', =>
|
||||
@quitting = false
|
||||
|
||||
clipboard = null
|
||||
ipc.on 'write-text-to-selection-clipboard', (event, selectedText) ->
|
||||
clipboard ?= require '../safe-clipboard'
|
||||
@ -434,6 +440,7 @@ class AtomApplication
|
||||
delete @pidsToOpenWindows[pid]
|
||||
|
||||
saveState: ->
|
||||
return if @quitting
|
||||
states = []
|
||||
for window in @windows
|
||||
unless window.isSpec
|
||||
|
@ -64,7 +64,10 @@ class WindowEventHandler
|
||||
|
||||
atom.storeDefaultWindowDimensions()
|
||||
atom.storeWindowDimensions()
|
||||
atom.unloadEditorWindow() if confirmed
|
||||
if confirmed
|
||||
atom.unloadEditorWindow()
|
||||
else
|
||||
ipc.send('cancel-window-close')
|
||||
|
||||
confirmed
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user