Hide window before doing unload work.

In this way we can give user the feeling of quick close even though the
unloading could take some time.
This commit is contained in:
Cheng Zhao
2013-05-24 20:12:42 +08:00
parent fa0a35741a
commit ce1c1e1f88
2 changed files with 11 additions and 2 deletions

View File

@@ -202,6 +202,9 @@ window.atom =
focus: ->
remote.getCurrentWindow().focus()
hide: ->
remote.getCurrentWindow().hide()
exit: (status) ->
@sendMessageToBrowserProcess('exit', [status])

View File

@@ -57,7 +57,10 @@ window.startEditorWindow = ->
atom.activatePackages()
keymap.loadUserKeymaps()
atom.requireUserInitScript()
$(window).on 'unload', -> unloadEditorWindow(); false
$(window).on 'unload', ->
atom.hide()
unloadEditorWindow()
false
$(window).focus()
window.startConfigWindow = ->
@@ -70,7 +73,10 @@ window.startConfigWindow = ->
deserializeConfigWindow()
atom.activatePackageConfigs()
keymap.loadUserKeymaps()
$(window).on 'unload', -> unloadConfigWindow(); false
$(window).on 'unload', ->
atom.hide()
unloadConfigWindow()
false
$(window).focus()
window.unloadEditorWindow = ->